This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Help with linking and symbol resolution
- From: Alan Modra <amodra at gmail dot com>
- To: Lakshay Garg <lakshaygarg1996+gcc at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 30 Jan 2017 15:20:33 +1030
- Subject: Re: Help with linking and symbol resolution
- Authentication-results: sourceware.org; auth=none
- References: <CAJq3jywFvezWrBWknbXyD3bZ9wZdNMwv80N71t=FfpV4bquzSA@mail.gmail.com>
On Sat, Jan 28, 2017 at 08:59:35PM +0530, Lakshay Garg wrote:
> From what I have learnt, I
> believe that the output of the file should be sizeof(c) = 4 since the
> declaration of c in f1.c is weak and would be resolved to the symbol c
> in file f2.c which is strong.
No. (Also don't ignore linker warnings).
Read the C standard regarding sizeof. What is the type of "c" in f1.c?
--
Alan Modra
Australia Development Lab, IBM