Bug 18553 - Annoying warning with -ffunction-sections -g
Annoying warning with -ffunction-sections -g
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: target
3.4.4
: P2 normal
: 4.1.2
Assigned To: denisc
: diagnostic
: 18552 (view as bug list)
Depends on:
Blocks: 29449
  Show dependency treegraph
 
Reported: 2004-11-18 19:41 UTC by Bernardo Innocenti
Modified: 2007-04-09 22:21 UTC (History)
3 users (show)

See Also:
Host:
Target: avr
Build:
Known to work:
Known to fail: 3.4.3 4.0.0
Last reconfirmed: 2005-12-16 02:02:27


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernardo Innocenti 2004-11-18 19:41:24 UTC
When building with both -ffunction-sections and
-g, the compiler outputs an invalid warning for
each compiled file:

  drv/timer.c:1: warning: -ffunction-sections may affect debugging on some targets

The code printing this is here:

--- gcc/toplev.c ---
#ifndef OBJECT_FORMAT_ELF
  if (flag_function_sections && write_symbols != NO_DEBUG)
    warning ("-ffunction-sections may affect debugging on some targets");
#endif
--- gcc/toplev.c ---

A possible fix could be adding elfos.h to the tm_file
list for the avr target in config.gcc, which may also
lead to simplifications in some parts of config/avr.h.
Comment 1 Andrew Pinski 2004-11-18 20:28:12 UTC
*** Bug 18552 has been marked as a duplicate of this bug. ***
Comment 2 Andrew Pinski 2004-11-18 20:41:43 UTC
Confirmed.
Comment 3 aesok 2006-11-20 18:16:37 UTC
Subject: Bug 18553

Author: aesok
Date: Mon Nov 20 18:16:21 2006
New Revision: 119019

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119019
Log:
	PR target/18553
	PR target/29449
	* config/avr/avr.h (OBJECT_FORMAT_ELF): Define.

	* config/avr/avr.h (DWARF2_DEBUGGING_INFO): Define.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr.h

Comment 4 aesok 2006-11-20 18:23:24 UTC
Subject: Bug 18553

Author: aesok
Date: Mon Nov 20 18:23:13 2006
New Revision: 119020

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119020
Log:
	PR target/18553
	PR target/29449
	* config/avr/avr.h (OBJECT_FORMAT_ELF): Define.

	* config/avr/avr.h (DWARF2_DEBUGGING_INFO): Define.

Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/config/avr/avr.h

Comment 5 aesok 2006-11-20 18:29:32 UTC
Subject: Bug 18553

Author: aesok
Date: Mon Nov 20 18:29:21 2006
New Revision: 119021

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119021
Log:
	PR target/18553
	PR target/29449
	* config/avr/avr.h (OBJECT_FORMAT_ELF): Define.

	* config/avr/avr.h (DWARF2_DEBUGGING_INFO): Define.

Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/config/avr/avr.h

Comment 6 aesok 2006-11-20 18:35:30 UTC
Fixed in trunk, 4.2 and 4.1.