Wednesday 31 January 2018

investigate the relationship between basic C source code and the output of the C compiler

This blog will be exploring around the explanation of compiled C code on Aarch64 Register architecture to learn how assembly language is used to understand C code.Assembly language is a symbolic representation of machine language. It is therefore architecture-specific.
#include <stdio.h>

int main() {
    printf("Hello World!\n");
}

Having this compiled chunk of code by including compiler options like

-g               # enable debugging information
-O0              # do not optimize (that's a capital letter and then the digit zero)
-fno-builtin     # do not use builtin function optimizations
 gcc -g -O0 -fno-builtin -o hello helloworld.c we will be creating a binary ELF(Executable and Linkable Format) file which contains multiple sections. These sections may contain object code, link tables, debugging symbols, program data(such as constants and initial values of variables)metadata about the program and ELF sections and comments. 
We could examine that binary produced by previous approach.The Objdump flags that I will use are listed and described below 
-f # display header information for the entire file
-s # display per-section summary information
-d # disassemble sections containing code
--source # (implies -d) show source code, if available, along with disassembly

1) By executing the command objdump -f -s -d --source hello The size of the generated file is 18KB. If we closely observe there will be a main section where we can see the code that we wrote and in the same section we can see the string to be printed.

2) By adding -static to our command to compile the code gcc -g -o0 -fno-builtin -o hello helloworld.c.Then in the same way we run the output through objdump with the same flags. A standarad input library is added into our assembly and the <printf@plt> instruction called is replaced with <_IO_printf> instruction. The size of objdump would be around 108 kb

3) Removing compiler option -fno-builtin <printf@puts> gets replaced by <puts@plt> GCC optimizes the code according depending on the source code here we have hello world string in printf which can be basically converted to puts according to gcc which is also used to display strings but if we had any character in it then it would have optimized it to putschar.

4)Removing compiler option -g says we don't want to see debugging information anymore which can save us upto 2 to 3 kb maybe or even less than that

5) Adding additional arguments to the printf() function in our program. We are displaying multiple integers using printf we can notice that each of those integers is stored in different register of memory and 1,2,3,4,5 are assigned in registers using mov while 6,7,8,9 are pushed using pushq into registers

6)adding -o3 to the gcc option and removing -o0 will be increasing performance of the code in terms of execution and running the program

From the above blog we assembly language can really help in understanding  compiled c code as it shows the information which directly goes to hardware we could say it is to low level as it shows the accurate information where our single bit data is getting loaded or stored in our registers which are present in our memory.


Monday 29 January 2018

How Open Source delivers Code Patch, Bug Fixes and much more to continue the cycle so called "DEVELOPMENT"


As we all know Open Source is really wide as it has got many communities involved in it each has different review process of work being submitted to them. Here I am gonna discuss about to of those community like Apache Subversion Features and Trac.


Apache Subversion is an open source version control system has many fascinating features which helps developer to contribute to open source environment easily. Basically an user has to create an account for reporting about the Issue/Bug it has been categorized as Bug, Improvement, New Feature, Task, Test, Wish. I noticed the contributors and many users posted several issues in which most of them where on the verge of getting solved completely or were in progress.

There are multiple options given where can describe more about the bug or issue by giving it more priority or can set it to important. Also it has got a history tab where it shows chats between admin and user along with the files exchanged. I came across one reporting of an issue where user and admin got stuck at certain point as admin working to find a solution while that particular developer was left unattended by other admin people or other high authority contributors but that soon that admin responded back to his issue and acknowledged him where he can get more assistance.

Diffing progressions against those repossess and having the ability to run fault with perceive who changed the thing that lines. They don't utilize it for rolling once more revisions extremely much, yet all the that likelihood will be extremely decent too. Now and then those organizer permissions get messed up and the icons don't demonstrate effectively. Exactly begin utilizing it. You won't think what amount of it will transform your an aggregation when you would.

In you need aid finishing At whatever sort of code that necessities maintenance, SVN will help you keep track about the thing that you finished The point when Also the reason you completed it. It also aides with verify you don't incidentally take off test code for The point when you send. Keeps code Around numerous developers sorted out. Profits would association Also lesquerella code blending.

Trac is a open source, Web-based venture administration Also bug following framework.  Trac integrates with real form control frameworks including subversion and Git. Trac's offers a straightforward methodology to venture administration Toward profoundly coordination ticket tracking, form control for which various storehouses for every surroundings need aid supported. It permits hyperlinking data between these systems, incorporate wiki substance specifically clinched alongside An ticket or rundown tickets naturally for wiki pages.
Extra venture administration offers incorporate grouping tickets under turning points What's more a roadmap the place the turning points Furthermore their advancement would recorded Furthermore imagined. The later action is indicated for a timeline page, clients would notified.For Trac venture administration Software, clients camwood power a OK dashboard starting with which you Might weigh present records about necessities Furthermore existing issues. There may be also a incorporated wiki part the place you could place regular information for others will offer Furthermore entry. An additional playing point numerous clients such as regarding Trac will be that it offers tonsil for plugins. Customization may be also An breeze, empowering clients on truly be On control for All that. Those framework will be likewise hails for a An ticketing interface that is precise cordial and Urges non-technical individuals to offer thoughts and help bug reports.
Those ticket framework camwood a chance to be utilized for following bugs, tasks, issues, episodes or whatever viable sort of ticket. Altered reports might be produced from parametric saved SQL queries or utilizing an intelligent media ticket inquiry framework. There is Additionally an coordinated circuit internet searcher Furthermore An fine-grained reasonably framework.