diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-06-12 16:49:51 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-06-12 16:49:51 +0000 |
commit | b9e57a387a6bdc15fd8bf477dc4d45131f0307d6 (patch) | |
tree | 83767656ddf103d5231f1d4348bb71e6f8401955 /gas/config | |
parent | d84feeaca53698f5e014813e923abe6807e13f22 (diff) | |
download | gdb-b9e57a387a6bdc15fd8bf477dc4d45131f0307d6.zip gdb-b9e57a387a6bdc15fd8bf477dc4d45131f0307d6.tar.gz gdb-b9e57a387a6bdc15fd8bf477dc4d45131f0307d6.tar.bz2 |
* subsegs.c (subseg_text_p): New function.
* as.h (subseg_text_p): Declare.
* read.c (do_align): Use subseg_text_p to set the default fill.
* write.c (subsegs_finish): Likewise.
* config/obj-coff.c (write_object_file): Likewise.
* config/tc-i386.h (md_maybe_text): Don't define.
(md_do_align): Use subseg_text_p to set the default fill.
* config/tc-m32r.c (m32r_do_align): Likewise.
* config/tc-sh.c (sh_do_align): Likewise.
* config/tc-sparc.h (md_do_align): Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/obj-coff.c | 5 | ||||
-rw-r--r-- | gas/config/tc-i386.h | 13 | ||||
-rw-r--r-- | gas/config/tc-m32r.c | 2 | ||||
-rw-r--r-- | gas/config/tc-sh.c | 7 | ||||
-rw-r--r-- | gas/config/tc-sparc.h | 2 |
5 files changed, 10 insertions, 19 deletions
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index a6bdaee..e4d51dd 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -3235,6 +3235,7 @@ write_object_file () at the next frag. */ subseg_set (frchain_ptr->frch_seg, frchain_ptr->frch_subseg); + #ifndef SUB_SEGMENT_ALIGN #define SUB_SEGMENT_ALIGN(SEG) 1 #endif @@ -3242,7 +3243,9 @@ write_object_file () md_do_align (SUB_SEGMENT_ALIGN (now_seg), (char *) NULL, 0, 0, alignment_done); #endif - frag_align (SUB_SEGMENT_ALIGN (now_seg), NOP_OPCODE, 0); + frag_align (SUB_SEGMENT_ALIGN (now_seg), + subseg_text_p (now_seg) ? NOP_OPCODE : 0, + 0); #ifdef md_do_align alignment_done: #endif diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h index 112e4bc..ef778c1 100644 --- a/gas/config/tc-i386.h +++ b/gas/config/tc-i386.h @@ -1,5 +1,6 @@ /* tc-i386.h -- Header file for tc-i386.c - Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation. + Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 1999 + Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -432,18 +433,10 @@ extern const struct relax_type md_relax_table[]; extern int flag_16bit_code; -#ifdef BFD_ASSEMBLER -#define md_maybe_text() \ - ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) -#else -#define md_maybe_text() \ - (now_seg != data_section && now_seg != bss_section) -#endif - #define md_do_align(n, fill, len, max, around) \ if ((n) && !need_pass_2 \ && (!(fill) || ((char)*(fill) == (char)0x90 && (len) == 1)) \ - && md_maybe_text ()) \ + && subseg_text_p (now_seg)) \ { \ char *p; \ p = frag_var (rs_align_code, 15, 1, (relax_substateT) max, \ diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c index 76fb9ab..9a10824 100644 --- a/gas/config/tc-m32r.c +++ b/gas/config/tc-m32r.c @@ -245,7 +245,7 @@ m32r_do_align (n, fill, len, max) { /* Only do this if the fill pattern wasn't specified. */ if (fill == NULL - && (now_seg->flags & SEC_CODE) != 0 + && subseg_text_p (now_seg) /* Only do this special handling if aligning to at least a 4 byte boundary. */ && n > 1 diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index e21962c..2752d03 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -2192,12 +2192,7 @@ sh_do_align (n, fill, len, max) int max; { if (fill == NULL -#ifdef BFD_ASSEMBLER - && (now_seg->flags & SEC_CODE) != 0 -#else - && now_seg != data_section - && now_seg != bss_section -#endif + && subseg_text_p (now_seg) && n > 1) { static const unsigned char big_nop_pattern[] = { 0x00, 0x09 }; diff --git a/gas/config/tc-sparc.h b/gas/config/tc-sparc.h index 2a05764..d5031f6 100644 --- a/gas/config/tc-sparc.h +++ b/gas/config/tc-sparc.h @@ -57,7 +57,7 @@ extern int sparc_pic_code; #define md_do_align(n, fill, len, max, around) \ if ((n) && (n) <= 10 && !need_pass_2 && !(fill) \ - && now_seg != data_section && now_seg != bss_section) \ + && subseg_text_p (now_seg)) \ { \ char *p; \ p = frag_var (rs_align_code, 1 << n, 1, (relax_substateT) 1024, \ |