From 9456465c211025cbe18b74c073302d164206a427 Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Thu, 4 Nov 2004 21:52:55 +0000 Subject: * config/tc-xtensa.c: Remove XTENSA_SECTION_RENAME ifdefs. (add_section_rename): Delete. Inlined into... (build_section_rename): ...here. Use xstrdup instead of strdup. (xtensa_section_rename): Drop "const" from argument and return types. (md_show_usage): Indent to match show_usage(). * config/tc-xtensa.h: Remove XTENSA_SECTION_RENAME ifdefs. (tc_canonicalize_section_name): Define. (md_elf_section_rename): Remove unused macro. * doc/as.texinfo (Overview): Document Xtensa --rename-section option. * doc/c-xtensa.texi (Xtensa Options): Likewise. (Frame Directive): Delete. --- gas/ChangeLog | 14 ++++++ gas/config/tc-xtensa.c | 123 +++++++++++++++++++++---------------------------- gas/config/tc-xtensa.h | 12 +---- gas/doc/as.texinfo | 1 + gas/doc/c-xtensa.texi | 36 ++------------- 5 files changed, 74 insertions(+), 112 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 6bc4de9..e9da493 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,17 @@ +2004-11-04 Bob Wilson + + * config/tc-xtensa.c: Remove XTENSA_SECTION_RENAME ifdefs. + (add_section_rename): Delete. Inlined into... + (build_section_rename): ...here. Use xstrdup instead of strdup. + (xtensa_section_rename): Drop "const" from argument and return types. + (md_show_usage): Indent to match show_usage(). + * config/tc-xtensa.h: Remove XTENSA_SECTION_RENAME ifdefs. + (tc_canonicalize_section_name): Define. + (md_elf_section_rename): Remove unused macro. + * doc/as.texinfo (Overview): Document Xtensa --rename-section option. + * doc/c-xtensa.texi (Xtensa Options): Likewise. + (Frame Directive): Delete. + 2004-11-04 Daniel Jacobowitz * configure.in: Remove arm-*-oabi and thumb-*-oabi. diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index b75de92..a2eaf96 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -517,10 +517,9 @@ static void set_expr_symbol_offset_diff bfd_boolean expr_is_equal (expressionS *, expressionS *); static void copy_expr (expressionS *, const expressionS *); -#ifdef XTENSA_SECTION_RENAME +/* Section renaming. */ + static void build_section_rename (const char *); -static void add_section_rename (char *, char *); -#endif /* ISA imported from bfd. */ @@ -647,9 +646,7 @@ enum option_no_workarounds, -#ifdef XTENSA_SECTION_RENAME option_rename_section_name, -#endif option_prefer_l32r, option_prefer_const16, @@ -716,9 +713,7 @@ struct option md_longopts[] = { "workaround-close-loop-end", no_argument, NULL, option_workaround_close_loop_end }, -#ifdef XTENSA_SECTION_RENAME { "rename-section", required_argument, NULL, option_rename_section_name }, -#endif /* XTENSA_SECTION_RENAME */ { "link-relax", no_argument, NULL, option_link_relax }, { "no-link-relax", no_argument, NULL, option_no_link_relax }, @@ -837,11 +832,9 @@ md_parse_option (int c, char *arg) warn_unaligned_branch_targets = TRUE; return 1; -#ifdef XTENSA_SECTION_RENAME case option_rename_section_name: build_section_rename (arg); return 1; -#endif /* XTENSA_SECTION_RENAME */ case 'Q': /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section @@ -909,18 +902,14 @@ md_show_usage (FILE *stream) { fputs ("\n\ Xtensa options:\n\ ---[no-]text-section-literals\n\ - [Do not] put literals in the text section\n\ ---[no-]absolute-literals\n\ - [Do not] default to use non-PC-relative literals\n\ ---[no-]target-align [Do not] try to align branch targets\n\ ---[no-]longcalls [Do not] emit 32-bit call sequences\n\ ---[no-]transform [Do not] transform instructions\n" -#ifdef XTENSA_SECTION_RENAME -"--rename-section old=new(:old1=new1)*\n\ - Rename section 'old' to 'new'\n" -#endif /* XTENSA_SECTION_RENAME */ - , stream); + --[no-]text-section-literals\n\ + [Do not] put literals in the text section\n\ + --[no-]absolute-literals\n\ + [Do not] default to use non-PC-relative literals\n\ + --[no-]target-align [Do not] try to align branch targets\n\ + --[no-]longcalls [Do not] emit 32-bit call sequences\n\ + --[no-]transform [Do not] transform instructions\n\ + --rename-section old=new Rename section 'old' to 'new'\n", stream); } @@ -11996,9 +11985,7 @@ copy_expr (expressionS *dst, const expressionS *src) } -/* Support for Tensilica's "--rename-section" option. */ - -#ifdef XTENSA_SECTION_RENAME +/* Support for the "--rename-section" option. */ struct rename_section_struct { @@ -12010,17 +11997,22 @@ struct rename_section_struct static struct rename_section_struct *section_rename; -/* Parse the string oldname=new_name:oldname2=new_name2 - and call add_section_rename. */ +/* Parse the string "oldname=new_name(:oldname2=new_name2)*" and add + entries to the section_rename list. Note: Specifying multiple + renamings separated by colons is not documented and is retained only + for backward compatibility. */ static void build_section_rename (const char *arg) { + struct rename_section_struct *r; char *this_arg = NULL; char *next_arg = NULL; - for (this_arg = strdup (arg); this_arg != NULL; this_arg = next_arg) + for (this_arg = xstrdup (arg); this_arg != NULL; this_arg = next_arg) { + char *old_name, *new_name; + if (this_arg) { next_arg = strchr (this_arg, ':'); @@ -12030,56 +12022,47 @@ build_section_rename (const char *arg) next_arg++; } } - { - char *old_name = this_arg; - char *new_name = strchr (this_arg, '='); - if (*old_name == '\0') - { - as_warn (_("ignoring extra '-rename-section' delimiter ':'")); - continue; - } - if (!new_name || new_name[1] == '\0') - { - as_warn (_("ignoring invalid '-rename-section' " - "specification: '%s'"), old_name); - continue; - } - *new_name = '\0'; - new_name++; - add_section_rename (old_name, new_name); - } - } -} + old_name = this_arg; + new_name = strchr (this_arg, '='); + if (*old_name == '\0') + { + as_warn (_("ignoring extra '-rename-section' delimiter ':'")); + continue; + } + if (!new_name || new_name[1] == '\0') + { + as_warn (_("ignoring invalid '-rename-section' specification: '%s'"), + old_name); + continue; + } + *new_name = '\0'; + new_name++; -static void -add_section_rename (char *old_name, char *new_name) -{ - struct rename_section_struct *r = section_rename; + /* Check for invalid section renaming. */ + for (r = section_rename; r != NULL; r = r->next) + { + if (strcmp (r->old_name, old_name) == 0) + as_bad (_("section %s renamed multiple times"), old_name); + if (strcmp (r->new_name, new_name) == 0) + as_bad (_("multiple sections remapped to output section %s"), + new_name); + } - /* Check for invalid section renaming. */ - for (r = section_rename; r != NULL; r = r->next) - { - if (strcmp (r->old_name, old_name) == 0) - as_bad (_("section %s renamed multiple times"), old_name); - if (strcmp (r->new_name, new_name) == 0) - as_bad (_("multiple sections remapped to output section %s"), - new_name); + /* Now add it. */ + r = (struct rename_section_struct *) + xmalloc (sizeof (struct rename_section_struct)); + r->old_name = xstrdup (old_name); + r->new_name = xstrdup (new_name); + r->next = section_rename; + section_rename = r; } - - /* Now add it. */ - r = (struct rename_section_struct *) - xmalloc (sizeof (struct rename_section_struct)); - r->old_name = strdup (old_name); - r->new_name = strdup (new_name); - r->next = section_rename; - section_rename = r; } -const char * -xtensa_section_rename (const char *name) +char * +xtensa_section_rename (char *name) { struct rename_section_struct *r = section_rename; @@ -12091,5 +12074,3 @@ xtensa_section_rename (const char *name) return name; } - -#endif /* XTENSA_SECTION_RENAME */ diff --git a/gas/config/tc-xtensa.h b/gas/config/tc-xtensa.h index cdf5cc2..585f1ce 100644 --- a/gas/config/tc-xtensa.h +++ b/gas/config/tc-xtensa.h @@ -287,15 +287,6 @@ typedef struct xtensa_segment_info_struct } xtensa_segment_info; -/* Section renaming is only supported in Tensilica's version of GAS. */ -#ifdef XTENSA_SECTION_RENAME -extern const char *xtensa_section_rename (const char *); -#else -/* Tensilica's section renaming feature is not included here. */ -#define xtensa_section_rename(name) (name) -#endif /* XTENSA_SECTION_RENAME */ - - extern const char *xtensa_target_format (void); extern void xtensa_init_fix_data (struct fix *); extern void xtensa_frag_init (fragS *); @@ -312,6 +303,7 @@ extern void xtensa_elf_section_change_hook (void); extern int xtensa_unrecognized_line (int); extern bfd_boolean xtensa_check_inside_bundle (void); extern void xtensa_handle_align (fragS *); +extern char *xtensa_section_rename (char *); #define TARGET_FORMAT xtensa_target_format () #define TARGET_ARCH bfd_arch_xtensa @@ -324,13 +316,13 @@ extern void xtensa_handle_align (fragS *); #define TC_FORCE_RELOCATION(fix) xtensa_force_relocation (fix) #define NO_PSEUDO_DOT xtensa_check_inside_bundle () #define tc_canonicalize_symbol_name(s) xtensa_section_rename (s) +#define tc_canonicalize_section_name(s) xtensa_section_rename (s) #define tc_init_after_args() xtensa_file_arch_init (stdoutput) #define tc_fix_adjustable(fix) xtensa_fix_adjustable (fix) #define tc_frob_label(sym) xtensa_frob_label (sym) #define tc_unrecognized_line(ch) xtensa_unrecognized_line (ch) #define md_do_align(a,b,c,d,e) xtensa_flush_pending_output () #define md_elf_section_change_hook xtensa_elf_section_change_hook -#define md_elf_section_rename(name) xtensa_section_rename (name) #define md_end xtensa_end #define md_flush_pending_output() xtensa_flush_pending_output () #define md_operand(x) diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo index 98e341c..a73edd7 100644 --- a/gas/doc/as.texinfo +++ b/gas/doc/as.texinfo @@ -424,6 +424,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [@b{--[no-]text-section-literals}] [@b{--[no-]absolute-literals}] [@b{--[no-]target-align}] [@b{--[no-]longcalls}] [@b{--[no-]transform}] + [@b{--rename-section} @var{oldname}=@var{newname}] @end ifset @c man end @end smallexample diff --git a/gas/doc/c-xtensa.texi b/gas/doc/c-xtensa.texi index 25065f8..c31d51a 100644 --- a/gas/doc/c-xtensa.texi +++ b/gas/doc/c-xtensa.texi @@ -85,6 +85,11 @@ including both relaxation and optimization. The default is rare cases when the instructions must be exactly as specified in the assembly source. Using @samp{--no-transform} causes out of range instruction operands to be errors. + +@item --rename-section @var{oldname}=@var{newname} +@kindex --rename-section +Rename the @var{oldname} section to @var{newname}. This option can be used +multiple times to rename multiple sections. @end table @node Xtensa Syntax @@ -529,7 +534,6 @@ The following directives are available: * Literal Position Directive:: Specify Inline Literal Pool Locations. * Literal Prefix Directive:: Specify Literal Section Name Prefix. * Absolute Literals Directive:: Control PC-Relative vs. Absolute Literals. -* Frame Directive:: Describe a stack frame. @end menu @node Schedule Directive @@ -744,36 +748,6 @@ Otherwise, the default is to assume PC-relative @code{L32R} addressing. The @code{absolute-@-literals} directive can then be used to override the default determined by the command-line options. -@node Frame Directive -@subsection frame -@cindex @code{frame} directive - -This directive tells the assembler to emit information to allow the -debugger to locate a function's stack frame. The syntax is: - -@smallexample - .frame @var{reg}, @var{size} -@end smallexample - -where @var{reg} is the register used to hold the frame pointer (usually -the same as the stack pointer) and @var{size} is the size in bytes of -the stack frame. The @code{.frame} directive is typically placed -near the @code{ENTRY} instruction for a function. - -In many circumstances, this information just duplicates the -information given in the function's @code{ENTRY} instruction; however, -there are two cases where this is not true: - -@enumerate -@item -The size of the stack frame is too big to fit in the immediate field -of the @code{ENTRY} instruction. - -@item -The frame pointer is different than the stack pointer, as with functions -that call @code{alloca}. -@end enumerate - @c Local Variables: @c fill-column: 72 @c End: -- cgit v1.1