mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-09 00:53:10 +00:00
* 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.
This commit is contained in:
@@ -1,3 +1,16 @@
|
|||||||
|
1999-06-12 Ian Lance Taylor <ian@zembu.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
1999-06-12 David O'Brien <obrien@freebsd.org>
|
1999-06-12 David O'Brien <obrien@freebsd.org>
|
||||||
|
|
||||||
* configure.in: (i[3456]86-*-freebsd*): Now defaults to ELF.
|
* configure.in: (i[3456]86-*-freebsd*): Now defaults to ELF.
|
||||||
|
|||||||
1
gas/as.h
1
gas/as.h
@@ -585,6 +585,7 @@ void subseg_set PARAMS ((segT seg, subsegT subseg));
|
|||||||
#ifdef BFD_ASSEMBLER
|
#ifdef BFD_ASSEMBLER
|
||||||
segT subseg_get PARAMS ((const char *, int));
|
segT subseg_get PARAMS ((const char *, int));
|
||||||
#endif
|
#endif
|
||||||
|
int subseg_text_p PARAMS ((segT));
|
||||||
|
|
||||||
void start_dependencies PARAMS ((char *));
|
void start_dependencies PARAMS ((char *));
|
||||||
void register_dependency PARAMS ((char *));
|
void register_dependency PARAMS ((char *));
|
||||||
|
|||||||
@@ -3235,6 +3235,7 @@ write_object_file ()
|
|||||||
at the next frag. */
|
at the next frag. */
|
||||||
|
|
||||||
subseg_set (frchain_ptr->frch_seg, frchain_ptr->frch_subseg);
|
subseg_set (frchain_ptr->frch_seg, frchain_ptr->frch_subseg);
|
||||||
|
|
||||||
#ifndef SUB_SEGMENT_ALIGN
|
#ifndef SUB_SEGMENT_ALIGN
|
||||||
#define SUB_SEGMENT_ALIGN(SEG) 1
|
#define SUB_SEGMENT_ALIGN(SEG) 1
|
||||||
#endif
|
#endif
|
||||||
@@ -3242,7 +3243,9 @@ write_object_file ()
|
|||||||
md_do_align (SUB_SEGMENT_ALIGN (now_seg), (char *) NULL, 0, 0,
|
md_do_align (SUB_SEGMENT_ALIGN (now_seg), (char *) NULL, 0, 0,
|
||||||
alignment_done);
|
alignment_done);
|
||||||
#endif
|
#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
|
#ifdef md_do_align
|
||||||
alignment_done:
|
alignment_done:
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/* tc-i386.h -- Header file for tc-i386.c
|
/* 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.
|
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;
|
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) \
|
#define md_do_align(n, fill, len, max, around) \
|
||||||
if ((n) && !need_pass_2 \
|
if ((n) && !need_pass_2 \
|
||||||
&& (!(fill) || ((char)*(fill) == (char)0x90 && (len) == 1)) \
|
&& (!(fill) || ((char)*(fill) == (char)0x90 && (len) == 1)) \
|
||||||
&& md_maybe_text ()) \
|
&& subseg_text_p (now_seg)) \
|
||||||
{ \
|
{ \
|
||||||
char *p; \
|
char *p; \
|
||||||
p = frag_var (rs_align_code, 15, 1, (relax_substateT) max, \
|
p = frag_var (rs_align_code, 15, 1, (relax_substateT) max, \
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ m32r_do_align (n, fill, len, max)
|
|||||||
{
|
{
|
||||||
/* Only do this if the fill pattern wasn't specified. */
|
/* Only do this if the fill pattern wasn't specified. */
|
||||||
if (fill == NULL
|
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
|
/* Only do this special handling if aligning to at least a
|
||||||
4 byte boundary. */
|
4 byte boundary. */
|
||||||
&& n > 1
|
&& n > 1
|
||||||
|
|||||||
@@ -2192,12 +2192,7 @@ sh_do_align (n, fill, len, max)
|
|||||||
int max;
|
int max;
|
||||||
{
|
{
|
||||||
if (fill == NULL
|
if (fill == NULL
|
||||||
#ifdef BFD_ASSEMBLER
|
&& subseg_text_p (now_seg)
|
||||||
&& (now_seg->flags & SEC_CODE) != 0
|
|
||||||
#else
|
|
||||||
&& now_seg != data_section
|
|
||||||
&& now_seg != bss_section
|
|
||||||
#endif
|
|
||||||
&& n > 1)
|
&& n > 1)
|
||||||
{
|
{
|
||||||
static const unsigned char big_nop_pattern[] = { 0x00, 0x09 };
|
static const unsigned char big_nop_pattern[] = { 0x00, 0x09 };
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ extern int sparc_pic_code;
|
|||||||
|
|
||||||
#define md_do_align(n, fill, len, max, around) \
|
#define md_do_align(n, fill, len, max, around) \
|
||||||
if ((n) && (n) <= 10 && !need_pass_2 && !(fill) \
|
if ((n) && (n) <= 10 && !need_pass_2 && !(fill) \
|
||||||
&& now_seg != data_section && now_seg != bss_section) \
|
&& subseg_text_p (now_seg)) \
|
||||||
{ \
|
{ \
|
||||||
char *p; \
|
char *p; \
|
||||||
p = frag_var (rs_align_code, 1 << n, 1, (relax_substateT) 1024, \
|
p = frag_var (rs_align_code, 1 << n, 1, (relax_substateT) 1024, \
|
||||||
|
|||||||
16
gas/read.c
16
gas/read.c
@@ -1173,21 +1173,7 @@ do_align (n, fill, len, max)
|
|||||||
|
|
||||||
if (fill == NULL)
|
if (fill == NULL)
|
||||||
{
|
{
|
||||||
int maybe_text;
|
if (subseg_text_p (now_seg))
|
||||||
|
|
||||||
#ifdef BFD_ASSEMBLER
|
|
||||||
if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
|
|
||||||
maybe_text = 1;
|
|
||||||
else
|
|
||||||
maybe_text = 0;
|
|
||||||
#else
|
|
||||||
if (now_seg != data_section && now_seg != bss_section)
|
|
||||||
maybe_text = 1;
|
|
||||||
else
|
|
||||||
maybe_text = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (maybe_text)
|
|
||||||
default_fill = NOP_OPCODE;
|
default_fill = NOP_OPCODE;
|
||||||
else
|
else
|
||||||
default_fill = 0;
|
default_fill = 0;
|
||||||
|
|||||||
@@ -564,6 +564,21 @@ section_symbol (sec)
|
|||||||
|
|
||||||
#endif /* BFD_ASSEMBLER */
|
#endif /* BFD_ASSEMBLER */
|
||||||
|
|
||||||
|
/* Return whether the specified segment is thought to hold text. */
|
||||||
|
|
||||||
|
int
|
||||||
|
subseg_text_p (sec)
|
||||||
|
segT sec;
|
||||||
|
{
|
||||||
|
#ifdef BFD_ASSEMBLER
|
||||||
|
return (bfd_get_section_flags (stdoutput, sec) & SEC_CODE) != 0;
|
||||||
|
#else
|
||||||
|
return (sec != data_section
|
||||||
|
&& sec != bss_section
|
||||||
|
&& strcmp (segment_name (sec), ".eh_frame") != 0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
subsegs_print_statistics (file)
|
subsegs_print_statistics (file)
|
||||||
FILE *file;
|
FILE *file;
|
||||||
|
|||||||
@@ -1372,7 +1372,8 @@ subsegs_finish ()
|
|||||||
any alignment is meaningless, and, moreover, will look weird
|
any alignment is meaningless, and, moreover, will look weird
|
||||||
if we are generating a listing. */
|
if we are generating a listing. */
|
||||||
frag_align (had_errors () ? 0 : SUB_SEGMENT_ALIGN (now_seg),
|
frag_align (had_errors () ? 0 : SUB_SEGMENT_ALIGN (now_seg),
|
||||||
NOP_OPCODE, 0);
|
subseg_text_p (now_seg) ? NOP_OPCODE : 0,
|
||||||
|
0);
|
||||||
|
|
||||||
/* frag_align will have left a new frag.
|
/* frag_align will have left a new frag.
|
||||||
Use this last frag for an empty ".fill".
|
Use this last frag for an empty ".fill".
|
||||||
|
|||||||
Reference in New Issue
Block a user