https://bugs.llvm.org/show_bug.cgi?id=33407

            Bug ID: 33407
           Summary: ARM: .ARM.extab sections not merged
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedb...@nondot.org
          Reporter: compn...@compnerd.org
                CC: llvm-bugs@lists.llvm.org

With `-ffunction-sections`, the `.ARM.extab` section entry is split around the
function boundaries.  The linker needs to coalesce them into a single
`.ARM.extab` section.  The ordering is important since the entries in the
`.ARM.extab` section are referenced from `.ARM.exidx` via the special
`ARM_PREL31` relocation type.

// RUN: %clang -target armv7-unknown-linux-gnueabi -ffunction-sections -c %s -o
- | %lld -shared - -o - | llvm-readobj -elf-output-style GNU -S -
int f();
int g() {
  try {
    return f();
  } catch (...) {
    return 1;
  }
}
int h();
int i() {
  try {
    return h();
  } catch (...) {
    return 2;
  }
}

ld.bfd:

  [ 7] .ARM.extab        PROGBITS        0000038c 00038c 000060 00   A  0   0 
4

ld.gold:

  [ 7] .ARM.extab        PROGBITS        00000324 000324 000060 00   A  0   0 
4

ld.lld:

  [ 1] .ARM.extab.text._Z1gv PROGBITS        00000134 000134 000030 00   A  0  
0  4
  [ 3] .ARM.extab.text._Z1iv PROGBITS        0000017c 00017c 000030 00   A  0  
0  4

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to