From: Doug Evans Date: Sun, 31 May 1998 22:46:56 +0000 (+0000) Subject: * config/tc-dvp.h (ELF_TC_SPECIAL_SECTIONS): Delete .vuoverlay_table. X-Git-Tag: gdb-4_18~2100 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3b51879b328384127528f7d10bd4b9ef87d2352;p=external%2Fbinutils.git * 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. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 87f21ed..937fd70 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 336bc76..c10c1c1 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 b204ad5..ea37407 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 },