This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: ld/2338: objdump -d -l doesn't work correctly


> Do you have a binutils testcase to show there is a problem with
> _bfd_dwarf2_find_nearest_line and -ffunction-sections? I'd like to
> fix it if possible.

Attached.  Compile with "-g -o t t.c" and "-g -ffunction-sections -o t t.c".


Before your patch:

t.o: In function `foo1':/home/eric/build/binutils/native/t.c:6: warning: the 
use of `tmpnam' is dangerous, better use `mkstemp'

t.o: In function `foo2':/home/eric/build/binutils/native/t.c:17: warning: the 
use of `tmpnam' is dangerous, better use `mkstemp'

so clearly bogus message with -ffunction-sections.


With your patch:

t.o: In function `foo1':/home/eric/build/binutils/native/t.c:6: warning: the 
use of `tmpnam' is dangerous, better use `mkstemp'

t.o: In function `foo1':t.c:(.text.foo1+0xe): warning: the use of `tmpnam' is 
dangerous, better use `mkstemp'

so no more bogus message but no source location either.

-- 
Eric Botcazou
#include <stdio.h>
#include <stdlib.h>

void foo1(void)
{
  char *s1 = tmpnam ("name");
}

void foo2(void)
{
  int s2 = mkstemp ("name");
}

int main(void)
{
  return 0;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]