Fix outputdots so that it doesn't errantly discard the first line of, e.g.,

CODE_FRAGMENT.  Also fix skip_past_newline to not skip past NUL.

	* bfd-in2.h: Regenerate.
	* libcoff.h: Regenerate.

	doc/
	* chew.c (skip_past_newline_1): New function.
	(outputdots): Call it.
	(skip_past_newline): Ditto.
This commit is contained in:
Doug Evans 2014-08-05 09:00:40 -07:00
parent e034b2cc9d
commit aaffae57f3
5 changed files with 43 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2014-08-05 Doug Evans <dje@google.com>
* bfd-in2.h: Regenerate.
* libcoff.h: Regenerate.
2014-08-05 Maciej W. Rozycki <macro@codesourcery.com>
* elfxx-mips.c (_bfd_mips_elf_discard_info): Set section's

View File

@ -1022,6 +1022,7 @@ extern struct coff_comdat_info * bfd_coff_get_comdat_section
void bfd_init (void);
/* Extracted from opncls.c. */
/* Set to N to open the next N BFDs using an alternate id space. */
extern unsigned int bfd_use_reserved_id;
bfd *bfd_fopen (const char *filename, const char *target,
const char *mode, int fd);
@ -1206,6 +1207,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
/* Extracted from bfdwin.c. */
/* Extracted from section.c. */
typedef struct bfd_section
{
/* The name of the section; the name isn't a copy, the pointer is
@ -2344,6 +2346,7 @@ unsigned int bfd_arch_mach_octets_per_byte
(enum bfd_architecture arch, unsigned long machine);
/* Extracted from reloc.c. */
typedef enum bfd_reloc_status
{
/* No errors detected. */
@ -2393,6 +2396,7 @@ typedef struct reloc_cache_entry
}
arelent;
enum complain_overflow
{
/* Do not complain on overflow. */
@ -2411,6 +2415,7 @@ enum complain_overflow
unsigned number. */
complain_overflow_unsigned
};
struct bfd_symbol; /* Forward declaration. */
struct reloc_howto_struct
{
@ -6027,6 +6032,7 @@ assembler and not (currently) written to any object files. */
/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */
BFD_RELOC_EPIPHANY_IMM8,
BFD_RELOC_UNUSED };
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
reloc_howto_type *bfd_reloc_type_lookup
(bfd *abfd, bfd_reloc_code_real_type code);
@ -6224,6 +6230,7 @@ bfd_boolean bfd_copy_private_symbol_data
(ibfd, isymbol, obfd, osymbol))
/* Extracted from bfd.c. */
enum bfd_direction
{
no_direction = 0,
@ -6508,6 +6515,7 @@ bfd_set_cacheable (bfd * abfd, bfd_boolean val)
return TRUE;
}
typedef enum bfd_error
{
bfd_error_no_error = 0,
@ -6543,6 +6551,7 @@ const char *bfd_errmsg (bfd_error_type error_tag);
void bfd_perror (const char *message);
typedef void (*bfd_error_handler_type) (const char *, ...);
bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
@ -6551,6 +6560,7 @@ void bfd_set_error_program_name (const char *);
bfd_error_handler_type bfd_get_error_handler (void);
typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
const char *bfd_version,
const char *bfd_file,

View File

@ -1,3 +1,9 @@
2014-08-05 Doug Evans <dje@google.com>
* chew.c (skip_past_newline_1): New function.
(outputdots): Call it.
(skip_past_newline): Ditto.
2014-08-05 Alan Modra <amodra@gmail.com>
* chew.c (print_stack_level, main): Cast result of pointer

View File

@ -265,6 +265,19 @@ skip_white_and_stars (src, idx)
return idx;
}
static unsigned int
skip_past_newline_1 (ptr, idx)
string_type *ptr;
unsigned int idx;
{
while (at (ptr, idx)
&& at (ptr, idx) != '\n')
idx++;
if (at (ptr, idx) == '\n')
return idx + 1;
return idx;
}
/***********************************************************************/
string_type stack[STACK];
@ -603,10 +616,12 @@ outputdots ()
while (at (tos, idx))
{
if (at (tos, idx) == '\n' && at (tos, idx + 1) == '.')
/* Every iteration begins at the start of a line. */
if (at (tos, idx) == '.')
{
char c;
idx += 2;
idx++;
while ((c = at (tos, idx)) && c != '\n')
{
@ -626,11 +641,13 @@ outputdots ()
idx++;
}
}
if (c == '\n')
idx++;
catchar (&out, '\n');
}
else
{
idx++;
idx = skip_past_newline_1 (tos, idx);
}
}
@ -1095,10 +1112,7 @@ icatstr ()
static void
skip_past_newline ()
{
while (at (ptr, idx)
&& at (ptr, idx) != '\n')
idx++;
idx++;
idx = skip_past_newline_1 (ptr, idx);
pc++;
}

View File

@ -625,6 +625,7 @@ extern bfd_boolean ppc_allocate_toc_section
extern bfd_boolean ppc_process_before_allocation
(bfd *, struct bfd_link_info *);
/* Extracted from coffcode.h. */
typedef struct coff_ptr_struct
{
/* Remembers the offset from the first symbol in the file for