diff --git a/output_chunks.cc b/output_chunks.cc index 2527a068..95ed96ee 100644 --- a/output_chunks.cc +++ b/output_chunks.cc @@ -308,6 +308,7 @@ static std::vector create_dynamic_section() { define(DT_INIT_ARRAYSZ, out::__init_array_end->value - out::__init_array_start->value); define(DT_FINI_ARRAY, out::__fini_array_start->value); define(DT_FINI_ARRAYSZ, out::__fini_array_end->value - out::__fini_array_start->value); + define(DT_DEBUG, 0); auto find = [](StringRef name) -> OutputChunk * { for (OutputChunk *chunk : out::chunks) diff --git a/test/dynamic.s b/test/dynamic.s index 78149ed7..ffadec8f 100644 --- a/test/dynamic.s +++ b/test/dynamic.s @@ -12,7 +12,7 @@ // RUN: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 // RUN: readelf --dynamic %t.exe | FileCheck %s -// CHECK: Dynamic section at offset 0x2048 contains 22 entries: +// CHECK: Dynamic section at offset 0x2048 contains 23 entries: // CHECK: Tag Type Name/Value // CHECK: 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1] // CHECK: 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] @@ -29,10 +29,11 @@ // CHECK: 0x0000000000000005 (STRTAB) 0x200228 // CHECK: 0x000000000000000a (STRSZ) 71 (bytes) // CHECK: 0x0000000000000004 (HASH) 0x200270 -// CHECK: 0x0000000000000019 (INIT_ARRAY) 0x2021d0 +// CHECK: 0x0000000000000019 (INIT_ARRAY) 0x2021e0 // CHECK: 0x000000000000001b (INIT_ARRAYSZ) 8 (bytes) -// CHECK: 0x000000000000001a (FINI_ARRAY) 0x2021c8 +// CHECK: 0x000000000000001a (FINI_ARRAY) 0x2021d8 // CHECK: 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) +// CHECK: 0x0000000000000015 (DEBUG) 0x0 // CHECK: 0x000000000000000c (INIT) 0x201030 // CHECK: 0x000000000000000d (FINI) 0x201020 // CHECK: 0x0000000000000000 (NULL) 0x0 diff --git a/test/symtab.s b/test/symtab.s index b1b0566c..911e6b99 100644 --- a/test/symtab.s +++ b/test/symtab.s @@ -26,7 +26,7 @@ // CHECK: 17: 0000000000000000 0 NOTYPE GLOBAL HIDDEN ABS __bss_start // CHECK: 18: 0000000000202140 0 NOTYPE GLOBAL HIDDEN 12 _end // CHECK: 19: 0000000000201011 0 NOTYPE GLOBAL HIDDEN 8 _etext -// CHECK: 20: 0000000000202128 0 NOTYPE GLOBAL HIDDEN 11 _edata +// CHECK: 20: 0000000000202138 0 NOTYPE GLOBAL HIDDEN 11 _edata .globl foo, bar, this_is_global local1: