This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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] sim: unify symbol table handling


On 15 Aug 2016 10:29, Trevor Saunders wrote:
> On Mon, Aug 15, 2016 at 10:22:04AM +0100, Nick Clifton wrote:
> > Hi Mike,
> > 
> > > Nick: can you double check the aarch64 & msp430 changes ?
> > > And see if in general this makes sense to you ?
> > 
> > Sure.
> > 
> > > diff --git a/sim/aarch64/interp.c b/sim/aarch64/interp.c
> > > [...]
> > >  /* Filter out (in place) symbols that are useless for disassembly.
> > >     COUNT is the number of elements in SYMBOLS.
> > >     Return the number of useful symbols. */
> > >  
> > > -static unsigned long
> > > -remove_useless_symbols (asymbol **symbols, unsigned long count)
> > > +static long
> > > +remove_useless_symbols (asymbol **symbols, long count)
> > 
> > I understand the change to a signed long, but personally I consider
> > it a mistake.  The number of symbols is always going to be a positive
> > value, and the need for an error value could easily be handled using
> > -1U instead of -1L.  But the problem is endemic to the BFD library's
> > symbol handling code, so I guess that it will have to stay.  *sigh*
> 
> or can we convert sim to C++ and use maybe<unsigned long> ? ;)

wouldn't really help when the underlying bfd lib uses long everywhere.

that said, while conceptually it makes sense, the chances of working
with an ELF that has more than 2^31 symbols seems extremely unlikely.
-mike

Attachment: signature.asc
Description: Digital signature


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