Skip to content
  1. Dec 08, 2016
  2. Dec 07, 2016
  3. Dec 06, 2016
  4. Dec 05, 2016
  5. Dec 04, 2016
  6. Dec 03, 2016
    • Rui Ueyama's avatar
      Factor out common code to a header. · 244a435a
      Rui Ueyama authored
      llvm-svn: 288599
      244a435a
    • Rafael Espindola's avatar
      Ignone SHF_INFO_LINK. · 27004d33
      Rafael Espindola authored
      Some elf producers (dtrace) put this flag in relocation sections and
      some (MC) don't. If we don't ignore the flag we end up with multiple
      relocation sections poiting to the same section, which we don't
      support.
      
      llvm-svn: 288585
      27004d33
    • George Rimar's avatar
      [ELF] - Implemented R_386_16 and R_386PC16 relocations · 1b3d34a2
      George Rimar authored
      A program or object file using R_386_8, R_386_16, R_386_PC16 or R_386_PC8
      relocations is not conformant to latest ABI. The R_386_16, and R_386_8
      relocations truncate the computed value to 16 - bits and 8 - bits
      respectively. R_386_PC16 and R_386_16 are used by some
      applications, for example by FreeBSD loaders.
      
      Previously we did not take addend in account for these relocation,
      counting it as 0, what is wrong and was a reason of hangs.
      
      This patch needed for example for FreeBSD pmbr (protective mbr).
      
      Differential revision: https://reviews.llvm.org/D27303
      
      llvm-svn: 288581
      1b3d34a2
    • George Rimar's avatar
      [ELF] - Change the way how we compute offsets for binary output. · 40c28c7f
      George Rimar authored
      Binary output feature is a bit confuzing. bfd and gold output differs a lot sometimes,
      though it is important for FreeBSD mbr loaders.
      
      Patch change the way how we compute file offsets for binary output.
      This fixes PR31196.
      
      Previously offsets were calculated basing on offsets and addresses of sections
      from the same loads:
      if (Sec == First)
        return alignTo(Off, Target->MaxPageSize, Sec->Addr);
      return First->Offset + Sec->Addr - First->Addr;
      
      bfd assigns offsets for each section to VA - MinVA:
      https://github.com/redox-os/binutils-gdb/blob/master/bfd/binary.c#L27
      https://github.com/redox-os/binutils-gdb/blob/master/bfd/binary.c#L255 
      (LMA == VA usually)
      
      This patch for now just stops creating phdrs for binary output. 
      An effect from this that no any additional calculation for offset is performed:
      
      uintX_t getFileAlignment(uintX_t Off, OutputSectionBase *Sec) {
      OutputSectionBase *First = Sec->FirstInPtLoad;
      // If the section is not in a PT_LOAD, we have no other constraint.
      if (!First)
        return Off; //**First is always null, condition always happens**
      
      That is enough now with combination of another patch to generate output
      that is similar to what bfd produce for mbr loader.
      
      Differential revision: https://reviews.llvm.org/D27341
      
      llvm-svn: 288580
      40c28c7f
Loading