From c3b51879b328384127528f7d10bd4b9ef87d2352 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Sun, 31 May 1998 22:46:56 +0000 Subject: [PATCH] * config/tc-dvp.h (ELF_TC_SPECIAL_SECTIONS): Delete .vuoverlay_table. (VUOVERLAY_SECTION_PREFIX,VUOVERLAY_TABLE_SECTION_NAME): Delete. * config/tc-dvp.c (vuoverlay_string_section): New static global. (md_begin): Create overlay string section. (create_vuoverlay_section): Put section name in overlay string section. Put string's offset in overlay table entry. --- gas/ChangeLog | 11 +++++++++++ gas/config/tc-dvp.c | 41 ++++++++++++++++++++++++++++++++++------- gas/config/tc-dvp.h | 7 +------ 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 87f21ed4736..937fd70e774 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,14 @@ +start-sanitize-sky +Sun May 31 15:43:06 1998 Doug Evans + + * config/tc-dvp.h (ELF_TC_SPECIAL_SECTIONS): Delete .vuoverlay_table. + (VUOVERLAY_SECTION_PREFIX,VUOVERLAY_TABLE_SECTION_NAME): Delete. + * config/tc-dvp.c (vuoverlay_string_section): New static global. + (md_begin): Create overlay string section. + (create_vuoverlay_section): Put section name in overlay string section. + Put string's offset in overlay table entry. + +end-sanitize-sky Fri May 29 18:13:12 1998 Ian Lance Taylor * config/tc-a29k.h (WORKING_DOT_WORD): Define. diff --git a/gas/config/tc-dvp.c b/gas/config/tc-dvp.c index 336bc76f84a..c10c1c1be79 100644 --- a/gas/config/tc-dvp.c +++ b/gas/config/tc-dvp.c @@ -161,11 +161,13 @@ static symbolS *vif_data_end; This value is kept absolute, for simplicity. */ static symbolS *mpgloc_sym; -/* Handle of the current .vuoverlay.foo section. */ +/* Handle of the current vu overlay section. */ static segT vuoverlay_section; -/* The .overlay section is a table mapping lma's to vma's. */ +/* The overlay table section is a table mapping lma's to vma's. */ static segT vuoverlay_table_section; +/* String table to record section names in the overlay table. */ +static segT vuoverlay_string_section; /* Table to map vu space labels to their overlay sections. Labels in vu space are first put in the ABS section to simplify @@ -319,7 +321,14 @@ md_begin () /* Must preserve the current seg/subseg. It is the initial one. */ segT orig_seg = now_seg; subsegT orig_subseg = now_subseg; - vuoverlay_table_section = subseg_new (VUOVERLAY_TABLE_SECTION_NAME, 0); + + vuoverlay_table_section = subseg_new (SHNAME_DVP_OVERLAY_TABLE, 0); + record_alignment (now_seg, 3); + vuoverlay_string_section = subseg_new (SHNAME_DVP_OVERLAY_STRTAB, 0); + /* Ensure first byte in executable is zero. So what if we waste + a few bytes. */ + FRAG_APPEND_1_CHAR (0); + subseg_set (orig_seg, orig_subseg); } @@ -2269,10 +2278,10 @@ vuoverlay_section_name (addr) for (fileno = 0; *file; ++file) fileno = (fileno << 1) + *file; if (addr->sy_value.X_op == O_constant) - asprintf (§ion_name, "%s.0x%x.%u.%u.%d", VUOVERLAY_SECTION_PREFIX, + asprintf (§ion_name, "%s.0x%x.%u.%u.%d", SHNAME_DVP_OVERLAY_PREFIX, (int) S_GET_VALUE (addr), fileno, lineno, counter); else - asprintf (§ion_name, "%s.unknvma.%u.%u.%d", VUOVERLAY_SECTION_PREFIX, + asprintf (§ion_name, "%s.unknvma.%u.%u.%d", SHNAME_DVP_OVERLAY_PREFIX, fileno, lineno, counter); ++counter; return section_name; @@ -2293,7 +2302,7 @@ create_vuoverlay_section (section_name, addr, start_label, end_label) segT orig_seg = now_seg; subsegT orig_subseg = now_subseg; - /* Create and get handle of .vuoverlay section. All vu symbols go here. + /* Create and get handle of a vu overlay section. All vu symbols go here. The section name must be unique in the entire executable. We achieve this by encoding the source file name and file number. Ick. ??? A cleaner way would be if mpg took a new argument that named the @@ -2329,11 +2338,29 @@ create_vuoverlay_section (section_name, addr, start_label, end_label) /* Add an entry to the vu overlay table. */ if (start_label) { - /* FIXME: should be a service routine to do these. */ expressionS exp; + const char *p; + symbolS * name_label; + + /* Put the section name in the overlay string table. */ + + subseg_set (vuoverlay_string_section, 0); + name_label = create_colon_label (0, LOCAL_LABEL_PREFIX, + unique_name ("secstr")); + /* FIXME: should be a utility to do this. */ + for (p = section_name; *p; ++p) + FRAG_APPEND_1_CHAR (*p); + FRAG_APPEND_1_CHAR (0); subseg_set (vuoverlay_table_section, 0); + /* FIXME: should be a utility to do these. */ + /* Offset into string table. */ + exp.X_op = O_symbol; + exp.X_add_symbol = name_label; + exp.X_add_number = 0; + emit_expr (&exp, 8); + /* The section's lma. */ exp.X_op = O_symbol; exp.X_add_symbol = start_label; diff --git a/gas/config/tc-dvp.h b/gas/config/tc-dvp.h index b204ad5b342..ea3740761bb 100644 --- a/gas/config/tc-dvp.h +++ b/gas/config/tc-dvp.h @@ -87,12 +87,7 @@ extern void dvp_frob_file PARAMS ((void)); #define DATA_SECTION_NAME ".vudata" #define BSS_SECTION_NAME ".vubss" -/* Other special section names. */ -#define VUOVERLAY_SECTION_PREFIX ".vuoverlay" -#define VUOVERLAY_TABLE_SECTION_NAME ".vuoverlay_table" - #define ELF_TC_SPECIAL_SECTIONS \ { ".vubss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, \ { ".vudata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \ - { ".vutext", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, \ - { ".vuoverlay_table", SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { ".vutext", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, -- 2.30.2