aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1998-01-27 14:56:15 +0000
committerRichard Henderson <rth@redhat.com>1998-01-27 14:56:15 +0000
commit76f9e5afa3c762dfcc3b2c92d2b6c349e0f6f0b2 (patch)
treecb80adfcb4f358107e60e9768e3d45ea6d1b3421
parent7b7a88d0e1b202635670ee85f7150cf387931d48 (diff)
downloadbinutils-76f9e5afa3c762dfcc3b2c92d2b6c349e0f6f0b2.zip
binutils-76f9e5afa3c762dfcc3b2c92d2b6c349e0f6f0b2.tar.gz
binutils-76f9e5afa3c762dfcc3b2c92d2b6c349e0f6f0b2.tar.bz2
* listing.c (MAX_BYTES): Use listing variables not constants.
(data_buffer): No longer an array, but a pointer. (calc_hex): sizeof(data_buffer) -> MAX_BYTES. (listing_listing): Allocate data_buffer.
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/listing.c16
2 files changed, 17 insertions, 6 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 8379fe7..5a95a62 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+Tue Jan 27 06:51:59 1998 Richard Henderson <rth@cygnus.com>
+
+ * listing.c (MAX_BYTES): Use listing variables not constants.
+ (data_buffer): No longer an array, but a pointer.
+ (calc_hex): sizeof(data_buffer) -> MAX_BYTES.
+ (listing_listing): Allocate data_buffer.
+
Tue Jan 27 06:38:35 1998 Richard Henderson <rth@cygnus.com>
* as.c (parse_args): Add --listing-lhs-width, --listing-lhs-width2,
diff --git a/gas/listing.c b/gas/listing.c
index 5e23e66..c37c743 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -194,12 +194,12 @@ static FILE *list_file;
before the start of the line. */
#define MAX_BYTES \
- (((LISTING_WORD_SIZE * 2) + 1) * LISTING_LHS_WIDTH \
- + ((((LISTING_WORD_SIZE * 2) + 1) * LISTING_LHS_WIDTH_SECOND) \
- * LISTING_LHS_CONT_LINES) \
+ (((LISTING_WORD_SIZE * 2) + 1) * listing_lhs_width \
+ + ((((LISTING_WORD_SIZE * 2) + 1) * listing_lhs_width_second) \
+ * listing_lhs_cont_lines) \
+ 20)
-static char data_buffer[MAX_BYTES];
+static char *data_buffer;
/* Prototypes. */
static void listing_message PARAMS ((const char *name, const char *message));
@@ -562,7 +562,7 @@ calc_hex (list)
/* Print as many bytes from the fixed part as is sensible */
byte_in_frag = 0;
while (byte_in_frag < frag_ptr->fr_fix
- && data_buffer_size < sizeof (data_buffer) - 3)
+ && data_buffer_size < MAX_BYTES - 3)
{
if (address == ~0)
{
@@ -582,7 +582,7 @@ calc_hex (list)
/* Print as many bytes from the variable part as is sensible */
while ((byte_in_frag
< frag_ptr->fr_fix + frag_ptr->fr_var * frag_ptr->fr_offset)
- && data_buffer_size < sizeof (data_buffer) - 3)
+ && data_buffer_size < MAX_BYTES - 3)
{
if (address == ~0)
{
@@ -924,6 +924,7 @@ listing_listing (name)
unsigned int width;
buffer = xmalloc (listing_rhs_width);
+ data_buffer = xmalloc (MAX_BYTES);
eject = 1;
list = head;
@@ -1029,7 +1030,10 @@ listing_listing (name)
list = list->next;
}
+
free (buffer);
+ free (data_buffer);
+ data_buffer = NULL;
}
void