Re: Wrong source when using `-S` in objdump

2016-05-03 Thread Albert Netymk
> > Please take a look at the .debug_line info in your object file with > "readelf -wl test.o". I expect you will see negative advances of line > number, at the address where you see repeated source lines. This is > normal. Compilers will emit code corresponding to a single line, at > different

Re: Wrong source when using `-S` in objdump

2016-04-10 Thread Alan Modra
On Fri, Apr 08, 2016 at 06:25:23PM +0200, Albert Netymk wrote: > test.c > ``` > void my_fun(int *arr, int N) > { > int sum = 0; > for (int i = 0; i < N; ++i) { > sum += arr[i]; > } > } > > int main(void) > { > return 0; > } > ``` > clang -c -g test.c ; objdump -S test.o > t

Wrong source when using `-S` in objdump

2016-04-08 Thread Albert Netymk
test.c ``` void my_fun(int *arr, int N) { int sum = 0; for (int i = 0; i < N; ++i) { sum += arr[i]; } } int main(void) { return 0; } ``` clang -c -g test.c ; objdump -S test.o > test.s `my_fun` appears twice in the disassembly code. Excerpt of test.s: ``` void my_fun(int *