You are on page 1of 4

login as: balaji

balaji@192.168.1.5's password:
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-141-generic x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

1 package can be updated.


0 updates are security updates.

New release '18.04.2 LTS' available.


Run 'do-release-upgrade' to upgrade to it.

*** System restart required ***


Last login: Sun Feb 17 12:38:47 2019 from 192.168.1.14
balaji
balaji@iaec-ubuntu-server1:~$ ls
10.25.18.txt bestaverage.c examples1.c htmgmt.c pointer si.c
swap.c tree.c
1.c billingsystem.c examples.c ipaddress.c profit.c sides.c
t1.c triangle.c
a.out cd examples.desktop leap.c project
slist1.c test1 y.c
areasales.c discount.c ex.c loop q10.c slist.c
test1.c young.c
array dlist.c file newbill.c q17.c
steelgrade.c test.c
arrayfun dynamic.c funct1.c new_file.c q3.cd string
testdyn.c
arraypointer12.c earth.c functions odd.c q5.c
string1-1.c testfile.txt
arraypointer1.c ebill.c grade.c pattern7.c q9.c
structure testprint.c
arraypointer.c ex2.c hotel.c pattern8.c readir.c
structure.c teststruct.c
balaji@iaec-ubuntu-server1:~$ file odd.c
odd.c: C source, ASCII text
balaji@iaec-ubuntu-server1:~$ gcc -c odd.c
balaji@iaec-ubuntu-server1:~$ ls
10.25.18.txt bestaverage.c examples1.c htmgmt.c pattern8.c
readir.c structure.c teststruct.c
1.c billingsystem.c examples.c ipaddress.c pointer si.c
swap.c tree.c
a.out cd examples.desktop leap.c profit.c
sides.c t1.c triangle.c
areasales.c discount.c ex.c loop project
slist1.c test1 y.c
array dlist.c file newbill.c q10.c
slist.c test1.c young.c
arrayfun dynamic.c funct1.c new_file.c q17.c
steelgrade.c test.c
arraypointer12.c earth.c functions odd.c q3.cd
string testdyn.c
arraypointer1.c ebill.c grade.c odd.o q5.c
string1-1.c testfile.txt
arraypointer.c ex2.c hotel.c pattern7.c q9.c
structure testprint.c
balaji@iaec-ubuntu-server1:~$ file odd.o
odd.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
balaji@iaec-ubuntu-server1:~$ nm a.out
0000000000601040 B __bss_start
0000000000601040 b completed.7593
0000000000601030 D __data_start
0000000000601030 W data_start
00000000004004a0 t deregister_tm_clones
0000000000400520 t __do_global_dtors_aux
0000000000600e18 t __do_global_dtors_aux_fini_array_entry
0000000000601038 D __dso_handle
0000000000600e28 d _DYNAMIC
0000000000601040 D _edata
0000000000601048 B _end
0000000000400614 T _fini
0000000000400540 t frame_dummy
0000000000600e10 t __frame_dummy_init_array_entry
0000000000400760 r __FRAME_END__
0000000000601000 d _GLOBAL_OFFSET_TABLE_
w __gmon_start__
0000000000400638 r __GNU_EH_FRAME_HDR
0000000000400400 T _init
0000000000600e18 t __init_array_end
0000000000600e10 t __init_array_start
0000000000400620 R _IO_stdin_used
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
0000000000600e20 d __JCR_END__
0000000000600e20 d __JCR_LIST__
w _Jv_RegisterClasses
0000000000400610 T __libc_csu_fini
00000000004005a0 T __libc_csu_init
U __libc_start_main@@GLIBC_2.2.5
0000000000400566 T main
U mkdir@@GLIBC_2.2.5
U open@@GLIBC_2.2.5
00000000004004e0 t register_tm_clones
0000000000400470 T _start
0000000000601040 D __TMC_END__
balaji@iaec-ubuntu-server1:~$ read elf a.out

-bash: read: `a.out': not a valid identifier


balaji@iaec-ubuntu-server1:~$ readelf a
a.out array/ arraypointer12.c arraypointer.c
areasales.c arrayfun/ arraypointer1.c
balaji@iaec-ubuntu-server1:~$ readelf a.out
Usage: readelf <option(s)> elf-file(s)
Display information about the contents of ELF format files
Options are:
-a --all Equivalent to: -h -l -S -s -r -d -V -A -I
-h --file-header Display the ELF file header
-l --program-headers Display the program headers
--segments An alias for --program-headers
-S --section-headers Display the sections' header
--sections An alias for --section-headers
-g --section-groups Display the section groups
-t --section-details Display the section details
-e --headers Equivalent to: -h -l -S
-s --syms Display the symbol table
--symbols An alias for --syms
--dyn-syms Display the dynamic symbol table
-n --notes Display the core notes (if present)
-r --relocs Display the relocations (if present)
-u --unwind Display the unwind info (if present)
-d --dynamic Display the dynamic section (if present)
-V --version-info Display the version sections (if present)
-A --arch-specific Display architecture specific information (if any)
-c --archive-index Display the symbol/file index in an archive
-D --use-dynamic Use the dynamic section info when displaying symbols
-x --hex-dump=<number|name>
Dump the contents of section <number|name> as bytes
-p --string-dump=<number|name>
Dump the contents of section <number|name> as strings
-R --relocated-dump=<number|name>
Dump the contents of section <number|name> as relocated
bytes
-z --decompress Decompress section before dumping it
-w[lLiaprmfFsoRt] or
--debug-
dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,
=frames-interp,=str,=loc,=Ranges,=pubtypes,
=gdb_index,=trace_info,=trace_abbrev,=trace_aranges,
=addr,=cu_index]
Display the contents of DWARF2 debug sections
--dwarf-depth=N Do not display DIEs at depth N or greater
--dwarf-start=N Display DIEs starting with N, at the same depth
or deeper
-I --histogram Display histogram of bucket list lengths
-W --wide Allow output width to exceed 80 characters
@<file> Read options from <file>
-H --help Display this information
-v --version Display the version number of readelf
balaji@iaec-ubuntu-server1:~$
balaji@iaec-ubuntu-server1:~$
balaji@iaec-ubuntu-server1:~$
balaji@iaec-ubuntu-server1:~$
balaji@iaec-ubuntu-server1:~$
balaji@iaec-ubuntu-server1:~$ readelf a.out |more
Usage: readelf <option(s)> elf-file(s)
Display information about the contents of ELF format files
Options are:
-a --all Equivalent to: -h -l -S -s -r -d -V -A -I
-h --file-header Display the ELF file header
-l --program-headers Display the program headers
--segments An alias for --program-headers
-S --section-headers Display the sections' header
--sections An alias for --section-headers
-g --section-groups Display the section groups
-t --section-details Display the section details
-e --headers Equivalent to: -h -l -S
-s --syms Display the symbol table
--symbols An alias for --syms
--dyn-syms Display the dynamic symbol table
-n --notes Display the core notes (if present)
-r --relocs Display the relocations (if present)
-u --unwind Display the unwind info (if present)
-d --dynamic Display the dynamic section (if present)
-V --version-info Display the version sections (if present)
-A --arch-specific Display architecture specific information (if any)
-c --archive-index Display the symbol/file index in an archive
-D --use-dynamic Use the dynamic section info when displaying symbols
-x --hex-dump=<number|name>
Dump the contents of section <number|name> as bytes
-p --string-dump=<number|name>
Dump the contents of section <number|name> as strings
-R --relocated-dump=<number|name>
Dump the contents of section <number|name> as relocated
bytes
-z --decompress Decompress section before dumping it
-w[lLiaprmfFsoRt] or
--debug-
dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,
=frames-interp,=str,=loc,=Ranges,=pubtypes,
=gdb_index,=trace_info,=trace_abbrev,=trace_aranges,
=addr,=cu_index]
Display the contents of DWARF2 debug sections
--dwarf-depth=N Do not display DIEs at depth N or greater
--dwarf-start=N Display DIEs starting with N, at the same depth
or deeper
-I --histogram Display histogram of bucket list lengths
-W --wide Allow output width to exceed 80 characters
@<file> Read options from <file>
-H --help Display this information
-v --version Display the version number of readelf
balaji@iaec-ubuntu-server1:~$ gcc -S odd.c -o out
balaji@iaec-ubuntu-server1:~$ vim out
balaji@iaec-ubuntu-server1:~$ gcc

You might also like