diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-09-12 16:59:49 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-09-12 16:59:49 +0000 |
commit | 45455cddda802f883f8ea8f341d68ccbb8c4735b (patch) | |
tree | 55b59372baf8b1095370550f139bcc3a2aacb9a9 | |
parent | be4514d38dd8c05e99b7a58a182913d0b9f09e80 (diff) | |
download | gdb-45455cddda802f883f8ea8f341d68ccbb8c4735b.zip gdb-45455cddda802f883f8ea8f341d68ccbb8c4735b.tar.gz gdb-45455cddda802f883f8ea8f341d68ccbb8c4735b.tar.bz2 |
1999-09-12 Donn Terry <donn@interix.com>
* ld.h (ld_abort): Declare.
(abort): Define.
* ldmisc.c (ld_abort): Define.
-rw-r--r-- | ld/ChangeLog | 8 | ||||
-rw-r--r-- | ld/ld.h | 11 | ||||
-rw-r--r-- | ld/ldmisc.c | 19 |
3 files changed, 38 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index f827b6b..ee9edf6 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,9 @@ 1999-09-12 Ian Lance Taylor <ian@zembu.com> + * pe.em: Don't include "../bfd/libbfd.h". + (gld_${EMULATION_NAME}_after_open): Use xmalloc rather than + bfd_alloc. + * pe-dll.h: New file. * pe-dll.c: Include "pe-dll.h". Mark unused arguments as needed to avoid warnings. @@ -23,6 +27,10 @@ 1999-09-12 Donn Terry <donn@interix.com> + * ld.h (ld_abort): Declare. + (abort): Define. + * ldmisc.c (ld_abort): Define. + * scripttempl/pe.sc: Use ${ENTRY} rather than _mainCRTStartup. Move .bss section after .rdata. Move .reloc section after .rsrc. @@ -223,4 +223,15 @@ extern void add_cref PARAMS ((const char *, bfd *, asection *, bfd_vma)); extern void output_cref PARAMS ((FILE *)); extern void check_nocrossrefs PARAMS ((void)); +extern void ld_abort PARAMS ((const char *, int, const char *)) + ATTRIBUTE_NORETURN; + +/* If gcc, we can give a function name, too. */ +#if !defined (__GNUC__) || __GNUC_MINOR__ <= 5 +#define __PRETTY_FUNCTION__ ((char*) NULL) +#endif + +#undef abort +#define abort() ld_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__) + #endif diff --git a/ld/ldmisc.c b/ld/ldmisc.c index 8fab228..267dff1 100644 --- a/ld/ldmisc.c +++ b/ld/ldmisc.c @@ -536,3 +536,22 @@ print_nl () { fprintf (config.map_file, "\n"); } + +/* A more or less friendly abort message. In ld.h abort is defined to + call this function. */ + +void +ld_abort (file, line, fn) + const char *file; + int line; + const char *fn; +{ + if (fn != NULL) + einfo (_("%P: internal error: aborting at %s line %d in %s\n"), + file, line, fn); + else + einfo (_("%P: internal error: aborting at %s line %d\n"), + file, line); + einfo (_("%P%F: please report this bug\n")); + xexit (1); +} |