From 936cf02ed4b2ba668a7a74a2dfff984c2a94be24 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Wed, 11 Feb 2004 01:35:14 +0000 Subject: [PATCH] Patch from Steve Ellcey for ia64-hpux. * config/tc-ia64.h (ia64_frob_symbol): New declaration. (tc_frob_symbol): New macro definition. * config/tc-ia64.c (ia64_frob_symbol): New routine. --- gas/ChangeLog | 6 ++++++ gas/config/tc-ia64.c | 17 +++++++++++++++++ gas/config/tc-ia64.h | 6 ++++++ 3 files changed, 29 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index d6fbbe7..50ded93 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2004-02-10 Steve Ellcey + + * config/tc-ia64.h (ia64_frob_symbol): New declaration. + (tc_frob_symbol): New macro definition. + * config/tc-ia64.c (ia64_frob_symbol): New routine. + 2004-02-09 Daniel Jacobowitz * config/tc-arm.c (md_begin): Mark .note.gnu.arm.ident as diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index 450b91f..fe66ffa 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -7119,6 +7119,23 @@ ia64_frob_label (sym) } } +#ifdef TE_HPUX +/* The HP-UX linker will give unresolved symbol errors for symbols + that are declared but unused. This routine removes declared, + unused symbols from an object. */ +int +ia64_frob_symbol (sym) + struct symbol *sym; +{ + if ((S_GET_SEGMENT (sym) == &bfd_und_section && ! symbol_used_p (sym) && + ELF_ST_VISIBILITY (S_GET_OTHER (sym)) == STV_DEFAULT) + || (S_GET_SEGMENT (sym) == &bfd_abs_section + && ! S_IS_EXTERNAL (sym))) + return 1; + return 0; +} +#endif + void ia64_flush_pending_output () { diff --git a/gas/config/tc-ia64.h b/gas/config/tc-ia64.h index 01f8219..d1a04ee 100644 --- a/gas/config/tc-ia64.h +++ b/gas/config/tc-ia64.h @@ -91,6 +91,9 @@ extern void ia64_end_of_source PARAMS((void)); extern void ia64_start_line PARAMS((void)); extern int ia64_unrecognized_line PARAMS((int ch)); extern void ia64_frob_label PARAMS((struct symbol *sym)); +#ifdef TE_HPUX +extern int ia64_frob_symbol PARAMS((struct symbol *sym)); +#endif extern void ia64_flush_pending_output PARAMS((void)); extern int ia64_parse_name (char *name, expressionS *e); extern int ia64_optimize_expr PARAMS((expressionS *l, operatorT op, @@ -118,6 +121,9 @@ extern void ia64_convert_frag (fragS *); #define md_start_line_hook() ia64_start_line () #define tc_unrecognized_line(ch) ia64_unrecognized_line (ch) #define tc_frob_label(s) ia64_frob_label (s) +#ifdef TE_HPUX +#define tc_frob_symbol(s,p) p |= ia64_frob_symbol (s) +#endif /* TE_HPUX */ #define md_flush_pending_output() ia64_flush_pending_output () #define md_parse_name(s,e,c) ia64_parse_name (s, e) #define tc_canonicalize_symbol_name(s) ia64_canonicalize_symbol_name (s) -- 2.7.4