Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2020-06-23 22:06:54 +0300
committerGitHub <noreply@github.com>2020-06-23 22:06:54 +0300
commit83105ba22461455f4343d6bb14976eba8b0b3f39 (patch)
tree8b77c01bd4c6bd5583fc6ff393d8b4fdbe4c5f87
parent109b4b6f4459e426dae6bfb6558efb2232c18622 (diff)
Revert "Emit DWARF debug_abbrev offset for compile units as a label instead of 0 (#19794)" (#20013)
This reverts commit 87ef5557017a8d822ae31587846a54fcd66daf1b. It breaks on iOS: https://github.com/mono/mono/issues/8806#issuecomment-648286417
-rw-r--r--mono/mini/dwarfwriter.c9
-rw-r--r--mono/mini/image-writer.c50
-rw-r--r--mono/mini/image-writer.h2
3 files changed, 6 insertions, 55 deletions
diff --git a/mono/mini/dwarfwriter.c b/mono/mini/dwarfwriter.c
index c93151ec613..bf2ff736feb 100644
--- a/mono/mini/dwarfwriter.c
+++ b/mono/mini/dwarfwriter.c
@@ -182,12 +182,6 @@ emit_int32 (MonoDwarfWriter *w, int value)
}
static void
-emit_symbol (MonoDwarfWriter *w, const char *symbol)
-{
- mono_img_writer_emit_symbol (w->w, symbol);
-}
-
-static void
emit_symbol_diff (MonoDwarfWriter *w, const char *end, const char* start, int offset)
{
mono_img_writer_emit_symbol_diff (w->w, end, start, offset);
@@ -805,7 +799,6 @@ mono_dwarf_writer_emit_base_info (MonoDwarfWriter *w, const char *cu_name, GSLis
w->cie_program = base_unwind_program;
emit_section_change (w, ".debug_abbrev", 0);
- emit_label (w, ".Ldebug_abbrev_start");
emit_dwarf_abbrev (w, ABBREV_COMPILE_UNIT, DW_TAG_compile_unit, TRUE,
compile_unit_attr, G_N_ELEMENTS (compile_unit_attr));
emit_dwarf_abbrev (w, ABBREV_SUBPROGRAM, DW_TAG_subprogram, TRUE,
@@ -849,7 +842,7 @@ mono_dwarf_writer_emit_base_info (MonoDwarfWriter *w, const char *cu_name, GSLis
emit_symbol_diff (w, ".Ldebug_info_end", ".Ldebug_info_begin", 0); /* length */
emit_label (w, ".Ldebug_info_begin");
emit_int16 (w, 0x2); /* DWARF version 2 */
- emit_symbol (w, ".Ldebug_abbrev_start"); /* .debug_abbrev offset */
+ emit_int32 (w, 0); /* .debug_abbrev offset */
emit_byte (w, sizeof (target_mgreg_t)); /* address size */
/* Compilation unit */
diff --git a/mono/mini/image-writer.c b/mono/mini/image-writer.c
index b191269667a..7314c5ee830 100644
--- a/mono/mini/image-writer.c
+++ b/mono/mini/image-writer.c
@@ -410,14 +410,11 @@ create_reloc (MonoImageWriter *acfg, const char *end, const char* start, int off
BinReloc *reloc;
reloc = (BinReloc *)mono_mempool_alloc0 (acfg->mempool, sizeof (BinReloc));
reloc->val1 = mono_mempool_strdup (acfg->mempool, end);
- if (start)
- {
- if (strcmp (start, ".") == 0) {
- reloc->val2_section = acfg->cur_section;
- reloc->val2_offset = acfg->cur_section->cur_offset;
- } else {
- reloc->val2 = mono_mempool_strdup (acfg->mempool, start);
- }
+ if (strcmp (start, ".") == 0) {
+ reloc->val2_section = acfg->cur_section;
+ reloc->val2_offset = acfg->cur_section->cur_offset;
+ } else {
+ reloc->val2 = mono_mempool_strdup (acfg->mempool, start);
}
reloc->offset = offset;
reloc->section = acfg->cur_section;
@@ -428,13 +425,6 @@ create_reloc (MonoImageWriter *acfg, const char *end, const char* start, int off
}
static void
-bin_writer_emit_symbol (MonoImageWriter *acfg, const char *symbol)
-{
- create_reloc (acfg, symbol, NULL, 0);
- acfg->cur_section->cur_offset += 4;
-}
-
-static void
bin_writer_emit_symbol_diff (MonoImageWriter *acfg, const char *end, const char* start, int offset)
{
create_reloc (acfg, end, start, offset);
@@ -1935,23 +1925,6 @@ asm_writer_emit_int32 (MonoImageWriter *acfg, int value)
}
static void
-asm_writer_emit_symbol (MonoImageWriter *acfg, const char *symbol)
-{
- if (acfg->mode != EMIT_LONG) {
- acfg->mode = EMIT_LONG;
- acfg->col_count = 0;
- }
-
- symbol = get_label (symbol);
-
- if ((acfg->col_count++ % 8) == 0)
- fprintf (acfg->fp, "\n\t%s ", AS_INT32_DIRECTIVE);
- else
- fprintf (acfg->fp, ",");
- fprintf (acfg->fp, "%s", symbol);
-}
-
-static void
asm_writer_emit_symbol_diff (MonoImageWriter *acfg, const char *end, const char* start, int offset)
{
#ifdef TARGET_ASM_APPLE
@@ -2241,19 +2214,6 @@ mono_img_writer_emit_int32 (MonoImageWriter *acfg, int value)
}
void
-mono_img_writer_emit_symbol (MonoImageWriter *acfg, const char *symbol)
-{
-#ifdef USE_BIN_WRITER
- if (acfg->use_bin_writer)
- bin_writer_emit_symbol (acfg, symbol);
- else
- asm_writer_emit_symbol (acfg, symbol);
-#else
- asm_writer_emit_symbol (acfg, symbol);
-#endif
-}
-
-void
mono_img_writer_emit_symbol_diff (MonoImageWriter *acfg, const char *end, const char* start, int offset)
{
#ifdef USE_BIN_WRITER
diff --git a/mono/mini/image-writer.h b/mono/mini/image-writer.h
index 309ec37c059..0c34246422e 100644
--- a/mono/mini/image-writer.h
+++ b/mono/mini/image-writer.h
@@ -98,8 +98,6 @@ void mono_img_writer_emit_int16 (MonoImageWriter *w, int value);
void mono_img_writer_emit_int32 (MonoImageWriter *w, int value);
-void mono_img_writer_emit_symbol (MonoImageWriter *w, const char *symbol);
-
void mono_img_writer_emit_symbol_diff (MonoImageWriter *w, const char *end, const char* start, int offset);
void mono_img_writer_emit_zero_bytes (MonoImageWriter *w, int num);