[PATCH] D15775: Add debugger rendezvous DT_DEBUG .dynamic entry

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 24 13:17:12 PST 2015


Why is mips special?

On 24 December 2015 at 14:48, Ed Maste <emaste at freebsd.org> wrote:
> emaste updated this revision to Diff 43612.
> emaste added a comment.
>
> - add test
> - add `DT_DEBUG` only to executables (use the presence of an entrypoint as a proxy for this)
>
>
> http://reviews.llvm.org/D15775
>
> Files:
>   ELF/OutputSections.cpp
>   test/ELF/dt_tags.s
>
> Index: test/ELF/dt_tags.s
> ===================================================================
> --- /dev/null
> +++ test/ELF/dt_tags.s
> @@ -0,0 +1,18 @@
> +# REQUIRES: x86
> +
> +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-freebsd %s -o %t
> +# RUN: ld.lld -shared %t -o %t.so
> +# RUN: ld.lld %t %t.so -o %t.exe
> +# RUN: llvm-readobj -dynamic-table %t.so | FileCheck -check-prefix=DSO %s
> +# RUN: llvm-readobj -dynamic-table %t.exe | FileCheck -check-prefix=EXE %s
> +
> +# EXE: DynamicSection [
> +# EXE:   0x0000000000000015 DEBUG                0x0
> +# EXE: ]
> +
> +# DSO: DynamicSection [
> +# DSO-NOT:   0x0000000000000015 DEBUG                0x0
> +# DSO: ]
> +
> +.globl _start
> +_start:
> Index: ELF/OutputSections.cpp
> ===================================================================
> --- ELF/OutputSections.cpp
> +++ ELF/OutputSections.cpp
> @@ -642,6 +642,9 @@
>    if (DtFlags1)
>      ++NumEntries; // DT_FLAGS_1
>
> +  if (!Config->Entry.empty() && Config->EMachine != EM_MIPS)
> +    ++NumEntries; // DT_DEBUG
> +
>    if (Config->EMachine == EM_MIPS) {
>      ++NumEntries; // DT_MIPS_RLD_VERSION
>      ++NumEntries; // DT_MIPS_FLAGS
> @@ -740,6 +743,8 @@
>      WriteVal(DT_FLAGS, DtFlags);
>    if (DtFlags1)
>      WriteVal(DT_FLAGS_1, DtFlags1);
> +  if (!Config->Entry.empty() && Config->EMachine != EM_MIPS)
> +    WriteVal(DT_DEBUG, 0);
>
>    // See "Dynamic Section" in Chapter 5 in the following document
>    // for detailed description:
>
>


More information about the llvm-commits mailing list