Get Better Ranking for your youtube videos

YouTube is the third most popular site in the world and the second most popular search engine after Google. Inclusion of YouTube in your online marketing strategy is very important compared to other social marketing platform as it owned by Google. Many Google searches now include YouTube video in its results. So, it is important to optimize your videos for YouTube search results as well as Google search results.

This article outlines how to get better ranking for your YouTube videos. Here is the infographic by by Martin Missfeldt on YouTube Ranking Factors.

YouTube Ranking Factors Infographics

YouTube Ranking Factors Infographics

Select keyword to get better ranking for your YouTube videos

Select keyword based on the search term you want to appear in Google and YouTube search results. In this article, i will use “study mbbs in philippines” as the keyword.

Modify File Name and Meta information of MP4 File

Change your video file (MP4 file) name based on the keyword selected. use hyphen (-) or underscore ( _) to separate words. After changing the file name, you can change the meta data of MP4 file to include your keywords in it.

Changing MP4 Properties

Changing MP4 Properties

Change title, subtitle, comments and tags in the file property window. Right click the file to get these details. Give a 5 star rating to your video. You can also add your company URL in the author URL. This gives more credibility to the video uploaded to YouTube.

Modify Title

Place your keyword in the beginning of the Title text. Try to limit to title text to less than 8 words.  To add all related keywords don’t use title text, specify it in tags instead.

Get Better Ranking for your youtube videos

Get Better Ranking for your youtube videos

Modify Description

Try to put lot of information in the description of the video. If there is not much content, at least write 300 words in description. Dont forget to mention keyword at the beginning of the description and mention it three to four times based on the total words in the description. You can also get backlinks to your website from youtube video description. Mention current YouTube video URL, your website URL, related blog URLs, etc

Add tags

Add as many relevant tags to the video. These tags help your video to get listed in the recommendation side bar.  Add at least 10 relevant tags. Apart from adding tags, you need to specify correct category, video location, language and recording date to gain more video authority ranking from Google.

Advanced Video Settings for seo

Advanced Video Settings for seo

Select most appealing thumbnail

Youtube gives three thumbnail options to choose from. Select the best appealing thumbnail from the list. If none of them is good, then you can alternatively upload your custom thumbnail. Custom thumbnail feature is not enabled by default. You need to go to account settings and verify your account by entering the code sent by them using SMS to your mobile.

Add Annotations

YouTube supports adding Annotations to the video. It is highlighted on the video based on the starting time and ending time set. Add at least 10 annotation with related keywords at different duration of the video. Don’t forget to add your company web site URL as one of your annotation. If you have verified your web site, you can also place link in the video at the end.

Adding keywords in Annotation

Adding keywords in Annotation

Video Transcriptions

If you have audio in your video, Google sometimes creates video transcriptions automatically. If it does not create one, you can create one in English. Mention your website URL, blog URL if any and keywords in it.

keyword in video transcriptions

keyword in video transcriptions

Add your video to playlist

If you do not have playlist create one playlist and add your uploaded video to the play list. For playlist you can have title, description, tags enriched with your keywords, company web site URL, blog URL.

play list settings for seo

play list settings for seo

 

Related Articles:

http://www.clickz.com/clickz/column/2351591/how-to-make-your-videos-rank-better-on-youtube

7 Off Page SEO Techniques to boost search ranking

7 On Page SEO Techniques to boost search ranking

Related Videos:

VAS Infotech Website: http://www.vasinfotech.in

7 Off Page SEO Techniques to boost search ranking

Off Page Search Engine Optimization includes activities that need to be performed apart from creating your web site. In this post I’ll cover the top 7 off-page optimization techniques that you can utilize to maximize your website search engine ranking. It is ordered below according to their priority.

Off Page SEO Techniques

Off Page SEO Techniques

1. Link Quality and Quantity

Majority of the factors which affect search engine ranking is related to quantity and quality of backlinks you get from other web sites.  More than quantity, it the quality of the web site (Who refers to your web page) plays significant role in search engine ranking.

2. Localize

Make your website local so that search engines can easily view your website and fetch its content. This will help you to reach a targeted audience. Submit your website to Google Local, Maps, Yahoo Local, Yellow Pages, Superpages, Hotfrog, etc.

3. Link Anchor Text

Anchor text or link text used to refer to your page is important for higher ranking. Using keywords in anchor text signals Google that linking sites thinks that content in your site is relevant to the keyword used in link anchor text.

4. Social Presence

Create account with Facebook, Google+, Twitter, LinkedIn, PInterest. The number of +1s you get in Google posting increases your ranking significantly. Merge your Google+ page with Google local business page. Verifying your business page with your web site gives boost for your ranking.

5. Social Shares

Social bookmark your pages in popular bookmarking sites like Pinterest, Digg, Delicious, StumbleUpon, etc.

Share your website documents like business documents, information brochures, and slides in Google Docs, Slide Share, etc. This will help you brand your website. Ask your friends to share or like your documents in social media websites to increase popularity.

6. How-to Videos

Create YouTube channel and upload How-to videos which demonstrates your product. YouTube can sometimes be used as backdoor to get into first page of Google search results for new sites. Add video gallery page to your website and embed your popular YouTube videos in it. When visitors watch videos from your web site, they stay in your site for longer time. This gets better ranking in search results.

7.Host WordPress blog on your website

Host wordpress blog on your web site and write blogs regularly on topics related to your business. Share these blogs on facebook, google+, twitter and other social bookmarking sites. This create back links from high domain authority social bookmarking sites, thereby increasing your web site search ranking.

7 On Page SEO Techniques to boost search ranking

On Page SEO means focusing on the content of the web site to increase search ranking for your web site. There is no point in trying to optimize your entire website(all pages in it) to one keyword phrase or placing all your keywords in home page(index.html). Doing either of them will reduce your ranking to appear in search results. Create separate web page for each keyword and optimize each page for one particular keyword.

On Page SEO Techniques

On Page SEO Techniques

This article outlines top 7 on page SEO techniques to boost your web site or blog search ranking ordered by priority.

1. Readable content with Keywords in it

Web page content is the key element not only for the customer but also for the search engine. If the content in your website is not original (copied or modified from other web sites), Google will not consider your content as valuable to be shown in the search results. Write your content in natural language as there is no need to repeat your keyword multiple times in web page. Keyword stuffing may sound unnatural for your customers to read your pages. Make sure that keyword is present in the first paragraph and placed within first 100 words. Add your keyword in alt tag of at least one image in your page.

2.Web Page Load Time

Do you know with sites having flash or lot of high resolution images load slow compared to plain text web sites. If you web page is slow, it decreases search engine ranking of your page significantly. Make sure your page loads with 4-5 seconds. If you have webpage with lot of images consider compressing your image using http://jpeg-optimizer.com/ or https://tinypng.com/

Use Google Webmaster PageSpeed Insight tool or http://gtmetrix.com to analyze if your website is slow.

3.Keyword in Web Page URL

Having the words you want to be found within your domain name or page URLs can help you get better ranking.

4. Title Tag

The title element of a web page should have concise description of a page’s content. This is critical to both user experience and search engine optimization. Google displays the first 50-60 characters of a title tag in search results. Remember to place important keywords at the start of the title tag.

<title>keyword1 – keyword2 | Brand</title>

5. Meta Description Tag

The meta description tag, allows you to suggest search engine how you want your pages to be described in search results. Though this tag may not increase your ranking, it will be shown to your customer in search results. So keywords should be present atleast once in description tag and it should make your customers click your site from the search results. Google display first 150 characters in search results. Below is a

<meta name="description" content="whatever written here will be shown in the search results page">

6.Header Tags

Header tags are a formal way to identify key sections of a web page. Placing your keywords once in h1 tag and h2 tag would increase your ranking. Placing exact keyword phrases in title, meta description, h1 tag, h2 tag and specifying it multiple times in body may signal Google that you are trying black hat SEO technique.

7. Internal Linking and sitemap

Linking to pages within your website is very important for search engine. This informs search engine that the website has lot of relevant content within it. Another important factor which is getting more attention nowadays is linking to high authority sites like wikipedia, forbes, ndtv, etc from your web page. Create sitemap.xml and sitemap.html so that search engine crawler knows the structure of your web site and crawls your pages efficiently. Add Quick Links to your website footer and Related Links sidebar containing links to other pages of your website. Link to category page or subcategory page from product page. If there is no categorization, link back to home page from all other pages.

Avoid locking in Singleton

The Singleton is a useful Design Pattern which allows only one instance of your class. Singleton is implemented by declaring static instance of the object reference within the class

class MySingleton {
static MySingleton *instance;
MySingleton() {
//...
}

public:
MySingleton* getInstance() {
return instance;
}

}

static MySingleton::instance= new MySingleton();

If singleton object is created during loading time itself, no locking is required. But in case of lazy loading, it needs to be guarded with a mutex to avoid multiple object instantiation.

MySingleton* getInstance() {

 //acquire mutex
if (NULL == instance) {
instance = new MySingleton();

 }

  //release mutex
return instance;
}

Every request to getInstance() includes mutex overhead.In order to avoid mutex overhead, double checked locking pattern can be used.

// Double-checked locking -- don't use
MySingleton* getInstance() {
if (NULL == instance) {
//acquire mutex
if (NULL==instance) {
instance = new MySingleton();
}
//release mutex
}
}

This method is not 100% safe because of compiler optimizations and may lead to undefined behavior which is hard to debug. Another technique(safe to use) is to use atomic operations and local variable as specified below.


MySingleton* getInstance() {
MySingleton *localRef = new MySingleton();

  int ret = testandset(&instance, 0, localRef);

  //note testandset function returns old value stored in the variable.
if (0==ret) {
return instance;
}
//some other thread had initialized this.

  delete localRef;

  return instance;
}

Symptoms of bad design

Code Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure-Fowler. In order to identify whether legacy software product requires code refactoring, one needs to know whether the existing system design is good or bad. The knowledge of bad design symptom also assists the designer to perform better.

Following are the symptoms of bad design

Rigidity: code/design is hard to change. Simple change requires lot of code changes.

Fragility: code/design is easy to break. code break in unexpected area.

Immobility:Hard to re-use code.

Viscosity:Make easier changes (hack) than fixing issues in-line with the current design.

Complexity: Too much anticipation of future need.

Repetition: Similar code in many places with slight change.

Low Cohesion: Less degree of connectivity among the elements of single class.

High Coupling: Interdependency between modules.

Code Level Optimization Techniques

Some of the techniques mentioned below “arithmetic operators”, “jump table to replace if…elseif”, “faster for loops” makes the code hard to debug, un-portable and un-maintainable. If there is no other way to optimize, then only attempt these techniques.

Use pass by reference for user defined type

Passing parameters by value to functions, result in the complete parameter being copied on to the stack. Pass by value shall be replaced by const references to avoid this data copy. Passing bigger objects as return values also has the same performance issues; instead replace it as OUT parameters for that function.

Pre-compute quantities to speed up run-time calculations

Avoid constant computing inside the loops. Though most of the compilers do this optimization, it is still better if it is handled in our code rather than relying on the compiler.

for (int i=0; i <100; i++) {
    offset = offset + strlen(str);
}
Shall be replaced to 

int size = strlen(str);
for (int i=0; i <100; i++) {
    offset = offset + size;
}

Avoid system calls in time critical section of the code 

System calls are costly as it involves switching into kernel mode from user mode. For instances where two process needs to communicate, using shared memory is better than using message queues of pipes as shared memory does not incur any system calls to send and receive data.

Lazy / Minimal Evaluation 

Lazy or delayed evaluation is the technique of delaying a computation until the result of the computation is actually needed for that code path. 

For example, if the expressions are concatenated using logical ‘AND’ or ‘OR’ operator, the expression is evaluated from left to right. We shall gain CPU cycles by placing the expressions in correct position

Consider the code example

if (strcmp(str, “SYSTEM”) && flag == 1)

{

   //…

}

In the above code segment, strcmp() function takes lot of time and for cases where flag != 1, it still does the comparison wasting lot of CPU cycles. The efficient code is

if (flag ==1 && strcmp(str, “SYSTEM”))

{

   //…

}

The same is applicable for OR logical operator when flag == 1. In general, for expressions using operator &&, make the condition that is most likely to be false the leftmost condition. For expressions using operator ||, make the condition that is most likely to be true the leftmost condition

Frequently executed cases should come first in the switch case or if..elseif statement so that the number of comparisons is reduced for the frequently executed case.

The following switch statement is inefficient as integer datatype, which is used most of the time, is placed in the last case and then string data type. Double data type is seldom used in most of the applications, but it is placed in the first case.

switch(dataType) {
  case typeDouble: { doDoubleAction(); break; }
  case typeDate: {doDateAction();; break; }
  case typeShort: {doShortAction();.; break; }
  case typeString: {doStringAction(); break; }
  case typeTimeStamp: {doTimeStampAction(); break; }
  case typeInt: { doIntAction(); break; }
  default: {doDefaultAction(); break; }
}
This shall be made efficient by keeping the frequently used data types first and followed by least and seldom-used data types.

switch(dataType) {
  case typeInt: {…; break; }
  case typeString: {…; break; }
  case typeShort: {…; break; }
  case typeDouble: {…; break; }
  case typeTimeStamp: {…; break; }
  case typeDate: {…; break; }
  default: {…; break; }
}
Much more elegant way is to implement a jump table using function pointers. Consider the following code

typedef void (*functs)();
functs JumpTable[] = { doIntAction, doStringAction(), doShortAction() /* etc*/} ;

Place your function pointers in the same sequence of dataType enum. The above JumpTable assumes that DataType enum is defined as follows

enum DataType{
typeInt =0,
typeString,
typeShort,
/* other types */
};

To call the appropriate implementation just use the following statement

JumpTable[dataType]();

Now the compare operations are replaced with array indexing operation, which are much faster. Moreover the time taken for every data type is nearly the same as compared to if..elseif and switch() constructs.

Minimize local variables

If the number of local variables in a function is less, then the compiler will be able to fit them into registers, thereby avoiding access to the memory (stack). If no local variables need to be saved on the stack, the compiler need not set up and restore the frame pointer.

Reduce number of parameters

Function calls with large number of parameters may be expensive due to large number of parameter pushes on stack on each call. This is applicable even when struct is passed by value. 

Declare local functions as static

If the function is small enough, it may be inlined without having to maintain an external copy if declared as static.

Avoid using global variables in performance critical code

Global variables are never allocated to registers. Global variables can be changed by assigning them indirectly using a pointer, or by a function call. Hence, the compiler cannot cache the value of a global variable in a register, resulting in extra loads and stores when globals are used. 

Pointer chains

Pointer chains are frequently used to access information in structures. For example, a common code sequence is:

 typedef struct { int x, y, color; } Point;

 typedef struct { Point *pos, int something; } Pixel;

 void initPixel(Pixel*p)

 {

 p->pos->x = 0;

 p->pos->y = 0;

 p->pos->color =0;

 }

However, this code must reload p->pos for each assignment. A better version would cache p->pos in a local variable:

 void initPixel(Pixel *p)

 {

 Point *pos = p->pos;

 pos->x = 0;

 pos->y = 0;

 pos->color = 0;

 }

Another way is to include the Point structure in the Pixel structure, thereby avoiding pointers completely. Some compilers do provide this optimization by default.

Replace frequent read/write with mmap

If the application does lot of read/write calls, then you should seriously consider to convert it into mmap() . This does not incur data copy from kernel to user and vice versa and avoids kernel mode switch for executing the read() or write() system call. You can use fsync() call, once to flush all the data to the disk file after you write all your data into the mapped memory area. 

Place elements together, which are accessed together

When you declare a structure make sure that the data elements are declared in such a way that most frequently accessed elements at the beginning

For example if page element is accessed many times and hasSpace little less and freeNode rarely, then declare the structure as follows.

Struct Node{

Int page;

Int hasSpace;

Int freeNode;

///other types

};

This improves the performance because L1 or L2 cache miss, will not get only the required byte, it also gets one full cache line size of data into the appropriate cache. When page is cached, it also caches hasSpace if cache line is 64 bit.  L1 cache line size is usually 64 bits and for L2, it is 128 bits.

Arithmetic operator

Replacing multiplication and division by shift and add operations.

X * 2 shall be replaced to X+X or X<<1

X * N shall be replaced by X<<I where N is 2 ^ I

X / N shall be replaced by X >>I where N is 2 ^ I

Faster for() loops 

for( i=0; i<10; i++){ … } 

If the code inside the loop does not care about the order of the loop counter, we can do this instead:

for( i=10; i–; ) { … }

This runs faster because it is quicker to process i– as the test condition, which says “Is i non-zero? If so, decrement it and continue”. For the original code, the processor has to calculate “Subtract i from 10. Is the result non-zero? If so, increment i and continue.” 

Prefer int over char and short

If you have an integer value that can fit in a byte, you should still consider using an int to hold the number. This is because, when you use a char, the compiler will first convert the values into integer, perform the operations and then convert back the result to char. Doing so, will increase the memory usage but decreases the CPU cycles 

Advise OS on how it should manage memory pages

Using madvise()  system call, we can specify how the swapping and prefetching should be handled by the operating system. If you are accessing data sequentially, OS can prefetch some pages and keep it ready before the program references it. If program accesses data in some memory location frequently, it shall be locked in physical memory avoiding page swap to disk, using mlock() system call.

Thread Design Techniques

A) Pipeline
Task is divided into multiple sub tasks and each thread is responsible for doing one subtask. Job is passed from one thread to other till it reaches the final state.

B) Master/Servant
Master thread does accept the work and delegates work to its servants. Servants are created on the fly by the master when a work arrives to the master. After finishing the job servants go away. For next work, master creates new servants.

C) Thread Pool
Master thread accepts the work and delegate it to predefined set of servants, called thread pool. This is usually accomplished by using a queuing mechanism in between. Master adds request to the queue and all the threads in the pool removes the request from the queue and handles it iteratively.

Porting Unix Socket code to Windows

Windows sockets and UNIX type berkeley sockets provide pretty much similar interface which eases the porting effort. Apart from regular network system calls such as socket(), bind(), listen(), accept(),etc two API calls are important in Windows sockets

WSAStartup()-> should be called before calling any other winsock APIs

WSACleanup()-> should be called when program exit

After a socket connection is established, data can be transferred using the standard read() and write() calls as in UNIX sockets. Sockets must be closed by using the closesocket() function in Windows instead of close() in case of Windows.

Header File:

winsock2.h

Library:

Ws2_32.lib

Alternatively, you can add below line to header file

#pragma comment(lib, “Ws2_32.lib”);

More information on this topic can be found here @ msdn

Network Debugging Utility – netstat

netstat is a useful tool for checking your network configuration and statistics.

When invoked with the –i flag, it displays statistics for the network interfaces currently configured.

Output

Kernel Interface table

Iface       MTU Met    RX-OK RX-ERR RX-DRPRX-OVR   TX-OK TX-ERRTX-DRPTX-OVR Flg

eth0       1500   0   245257      0            0            0               118056      0        0              0     BMRU

lo        16436   0    23632        0            0            0                23632       0       0               0       LRU

The MTU and Met fields show the current MTU and metric values for that interface. The RX and TX columns show how many packets have been received or transmitted error-free (RX-OK/TX-OK) or damaged (RX-ERR/TX-ERR); how many were dropped (RX-DRP/TX-DRP); and how many were lost because of an overrun (RX-OVR/TX-OVR).

When invoked with –a flag, netstat displays all the active internet socket connections

Output

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address               Foreign Address             State

tcp        0      0 prabakaran:irdmi            *:*                         LISTEN

tcp        0      0 *:43812                     *:*                         LISTEN

tcp        0      0 *:mysql                     *:*                         LISTEN

tcp        0      0 *:sunrpc                    *:*                         LISTEN

tcp        0      0 prabakaran:ncube-lm         prabakaran:49594            ESTABLISHED

tcp        0      0 prabakaran:49594            prabakaran:ncube-lm         ESTABLISHED

udp        0      0 prabakaran:filenet-cm       *:*

Active UNIX domain sockets (servers and established)

Proto RefCnt Flags       Type       State         I-Node Path

unix  2      [ ACC ]     STREAM     LISTENING     5624   @/tmp/fam-root-

unix  2      [ ACC ]     STREAM     LISTENING     5039   /var/run/cups/cups.sock

unix  2      [ ACC ]     STREAM     LISTENING     4986   /var/run/avahi-daemon/socket

unix  2      [ ACC ]     STREAM     LISTENING     6130   /tmp/.X11-unix/X0

where

   Proto

       specifies the protocol used by the socket(tcp, upd or raw)

   Recv-Q

       Total bytes not copied by the user program connected to this socket.

   Send-Q

       Total bytes not acknowledged by the remote host.

   Local Address

       Address and port number of the local end of the socket. 

   Foreign Address

       Address and  port  number of the remote end of the socket.

   State

       It represents Socket state and is applicable only for TCP sockets. Possible values are

       ESTABLISHED

              The socket has an established connection.

       SYN_SENT

              The socket is actively attempting to establish a connection.

       SYN_RECV

              A connection request has been received from the network.

       FIN_WAIT1

              The socket is closed, and the connection is shutting down.

       FIN_WAIT2

              Connection is closed, and socket is waiting for a shutdown from the remote end.

       TIME_WAIT

              The socket is waiting after close to handle packets still in the network.

       CLOSED

               The socket is not being used.

       CLOSE_WAIT

              The remote end has shut down, waiting for the socket to close.

       LAST_ACK

              The remote end has shut down, and socket is closed but waiting for acknowledgement.

       LISTEN

              The socket is listening for incoming connections.

       CLOSING

              Both sockets are shut down but we still don’t have all our data sent.

       UNKNOWN

              The state of the socket is unknown.

When invoked with –p option, it displays the process ID and executable file name for all sockets.

Output

Active Internet connections (w/o servers)

Proto Recv-Q Send-Q Local Address      Foreign Address       State                  PID/Program name

tcp        0         0    prabakaran:ncube-lm  prabakaran:49594   ESTABLISHED    1750/tnslsnr

…..

This option will help to know the process which owns the socket when bind() call returns “address already in use” for the port.

When invoked with –s option, it displays statistics of TCP, UDP, IP protocol such as total number of active and passive connections for TCP, failed connection attempts for TCP, established connections for TCP, total TCP segments received and sent, total UDP packets received and sent, packet receive errors for UDP, etc.

Inspecting What is inside executable or library

Sometimes, it is necessary to know what dynamic libraries an executable depends on and what functions are defined in particular library, etc. In this blog, some tools which aid understanding the content of executable / library is discussed.

size

Size is a diagnostic tool for executable file analysis. This utility displays the total size for each object file. The running program of the computer is called a process. Each process of the computer allocates some memory from RAM known as process memory. The process memory of the computer is divided into different blocks segment such as code, data, heap and stack.

Ex.

int x=100; // data

int y; // bss

void main()

{

static int a=10; // data

static int b; // bss

In the above program x and y are external variables where as a and b are static variable. All external and initialize static and external variable are created in Data Segment but uninitialized static and external variables are created in bss (uninitialized data segment) segment. To view the memory allocation by each of these segment we can use the size command.

$ size ./a.out

output:

data bss dec hex filename

252 8 1319 527 a.out

You can type the object files name to be examined. If none are specified, the file "a.out" will be used.

options

-d The total size is always displayed in decimal format.

-o The total size is always displayed in octal format.

$ size -x ./a.out

text data bss dec hex filename

0x3b7 0x100 0x10 1223 4c7 ./a.out

$ size -o ./a.out

text data bss oct hex filename

01667 0400 020 2307 4c7 ./a.out

ldd

ldd is a diagnostic tool for executable file analysis. It shows which shared libraries an executable would use in your environment. A C program is nothing but collection of some functions. Every function is defined in a library file (static/dynamic library). When a program is loaded along with that the respective dynamic libraries are loaded. To enhance yourself with the dynamic libraries used in your program you are equipped with a development tool called ldd. It gives you brief details about which dynamic library is loaded & which dynamic library is missing in your program.

Ex.

main()

{

printf(“Hello”);

bbsr();

Here main.c is the source file. On compiling generates the object file ( main.o). Now the object file is linked with the dynamic libraries (libc.so, sample.so) to build the executable file(singo).

For Example:

$ldd ./singo

Output :

linux-gate.so.1 => (0x00110000)

sample.so=> not found

libc.so.6 => /lib/libc.so.6 (0x00367000)

/lib/ld-linux.so.2 (0x00348000) 

nm

This command list symbol names from object file. These symbol names can be either functions, global variables or static variables. For each symbol the value, symbol type & symbol names are displayed. Lower case symbol types means the symbol is local , upper case means the symbol is global.

Options:

-S print size of undefined symbols

-D Print dynamic, not normal, symbols. Useful only when working with dynamic objects (for example some kinds of shared libraries).

-l For each symbol, use debugging information to try to find a file name and line number. For a defined symbol, look for the line number of the address of the symbol. For an undefined symbol, look for the line number of a relocation entry which refers to the symbol. If line number information can be found, print it after the other symbol information.

Ex.

//prg.c

main()

{

bbsr();

printf(“Hello”);

ctc();

}

int ctc()

{

printf(“I am incuttack”);

}

$ gcc -c prg.c

$nm prg.o

output:

U bbsr

00000030 T ctc

00000000 T main

U printf

Here in the above output printf() & bbsr() are undefined.

$ nm -D -l -S ./a.out

080484b8 00000004 R _IO_stdin_used

w __gmon_start__

U __libc_start_main

U printf 

objdump

It displays information about object files.

This command is used to disassemble shared objects & libraries. It locates the method in which the problem originates.

Options:

-d Display the assembler mnemonics for the machine instructions from object file. This option disassembles only those sections that are expected to contain instructions.

-s Display the full contents of any section requested.

-h Display summary information from the section headers of the object file.

using objdump -h to list the file section headers can’t show the correct addresses. Instead, it shows the usual addresses, which are implicit for the target.

Example

//prg1.c

main()

{

static int x=12;

static int y;

printf(“%d”,x);

bbsr();

}

int bbsr()

{

printf(“Hi”);

}

$objdump -h ./a.out

output:

./a.out: file format elf32-i386

Sections:

Idx Name Size VMA LMA File off Algn

0 .interp 00000013 08048134 08048134 00000134 2**0

CONTENTS, ALLOC, LOAD, READONLY, DATA

1 .note.ABI-tag 00000020 08048148 08048148 00000148 2**2

CONTENTS, ALLOC, LOAD, READONLY, DATA

2 .note.gnu.build-id 00000024 08048168 08048168 00000168 2**2

CONTENTS, ALLOC, LOAD, READONLY, DATA

$ objdump -s -j .rowdata ./a.out

output:

a.out: file format elf32-i386

$ objdump -d -r -j .text ./a.out

output:

./a.out: file format elf32-i386

Disassembly of section .text:

080482f0 <_start>:

80482f0: 31 ed xor %ebp,%ebp

80482f2: 5e pop %esi

80482f3: 89 e1 mov %esp,%ecx

80482f5: 83 e4 f0 and $0xfffffff0,%esp

80482f8: 50 push %eax

The above output is the disassembly of text section with the -d flag. This option disassembles the section which are expected to contains the instructions.