mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 10:34:21 +08:00
* as.c: added new option -ad for hll listings without debug info
* listing.c,listing.h: support for new listings, and more for forgiving when lied to about where linenumbers are. * config/obj-coffbfd.c (do_linenos_for): relocate line numbers correctly.
This commit is contained in:
@ -1524,6 +1524,7 @@ DEFUN(do_linenos_for,(abfd, file_cursor),
|
|||||||
{
|
{
|
||||||
segment_info_type *s = segment_info + idx;
|
segment_info_type *s = segment_info + idx;
|
||||||
|
|
||||||
|
|
||||||
if (s->scnhdr.s_nlnno != 0)
|
if (s->scnhdr.s_nlnno != 0)
|
||||||
{
|
{
|
||||||
struct lineno_list *line_ptr ;
|
struct lineno_list *line_ptr ;
|
||||||
@ -1534,20 +1535,28 @@ DEFUN(do_linenos_for,(abfd, file_cursor),
|
|||||||
struct external_lineno *dst= buffer;
|
struct external_lineno *dst= buffer;
|
||||||
|
|
||||||
/* Run through the table we've built and turn it into its external
|
/* Run through the table we've built and turn it into its external
|
||||||
form */
|
form, take this chance to remove duplicates */
|
||||||
|
|
||||||
for (line_ptr = s->lineno_list_head;
|
for (line_ptr = s->lineno_list_head;
|
||||||
line_ptr != (struct lineno_list *)NULL;
|
line_ptr != (struct lineno_list *)NULL;
|
||||||
line_ptr = line_ptr->next)
|
line_ptr = line_ptr->next)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (line_ptr->line.l_lnno == 0)
|
if (line_ptr->line.l_lnno == 0)
|
||||||
{
|
{
|
||||||
/* Turn a pointer to a symbol into the symbols' index */
|
/* Turn a pointer to a symbol into the symbols' index */
|
||||||
line_ptr->line.l_addr.l_symndx =
|
line_ptr->line.l_addr.l_symndx =
|
||||||
( (symbolS *)line_ptr->line.l_addr.l_symndx)->sy_number;
|
( (symbolS *)line_ptr->line.l_addr.l_symndx)->sy_number;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
line_ptr->line.l_addr.l_paddr += ((struct frag * )(line_ptr->frag))->fr_address;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
(void) bfd_coff_swap_lineno_out(abfd, &(line_ptr->line), dst);
|
(void) bfd_coff_swap_lineno_out(abfd, &(line_ptr->line), dst);
|
||||||
dst++;
|
dst++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s->scnhdr.s_lnnoptr = *file_cursor;
|
s->scnhdr.s_lnnoptr = *file_cursor;
|
||||||
@ -1810,6 +1819,7 @@ DEFUN(c_line_new,(symbol, paddr, line_number, frag),
|
|||||||
|
|
||||||
segment_info_type *s = segment_info + now_seg;
|
segment_info_type *s = segment_info + now_seg;
|
||||||
new_line->line.l_lnno = line_number;
|
new_line->line.l_lnno = line_number;
|
||||||
|
|
||||||
if (line_number == 0)
|
if (line_number == 0)
|
||||||
{
|
{
|
||||||
new_line->line.l_addr.l_symndx = (long)symbol;
|
new_line->line.l_addr.l_symndx = (long)symbol;
|
||||||
|
Reference in New Issue
Block a user