[LLVMdev] [yaml2obj] ELF relocation support

Simon Atanasyan simon at atanasyan.com
Wed Apr 2 10:54:30 PDT 2014


Hi,

On Wed, Apr 2, 2014 at 1:03 AM, Michael Spencer <bigcheesegs at gmail.com> wrote:
> On Mon, Mar 31, 2014 at 10:54 AM, Simon Atanasyan <simon at atanasyan.com> wrote:
>> As far as I understand now it is impossible to generate ELF object
>> file with relocation sections using yaml2obj tool. I plan to support
>> ELF relocations in the yaml2obj. Does anybody work on it already or
>> plan to start this task soon?
>
> I know of nobody working on this. It would be great to have, thanks!

I am going to add "Relocations" optional list to the "Section"
element. So a YAML file will look like below. An alternative option is
to introduce new top-level list "Relocation Sections" with "Relocation
Section" entries. But I think this solution is a little bit over
designed.

Any objections / suggestions?

[[
Sections:
  - Name: .text
    Type: SHT_PROGBITS
    Content: "0000000000000000"
    AddressAlign: 16
    Flags: [SHF_ALLOC]

  - Name: .rel.text
    Type: SHT_REL
    Info: .text
    AddressAlign: 4
    Relocations:
      - !Relocation
        Offset: 0x1
        SymbolName: glob1
        Type: R_MIPS_32
      - !Relocation
        Offset: 0x2
        SymbolName: glob2
        Type: R_MIPS_CALL16
]]

-- 
Simon Atanasyan



More information about the llvm-dev mailing list