7 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I would like to relocate strings based on the index number.
Index numbers are shown on the first column, the strings are shown on the second column.
1 path_sparc_ifu_dec_104
1 path_sparc_ifu_dec_105
2 path_sparc_ifu_dec_63
2 ... (3 Replies)
Discussion started by: jypark22
3 Replies
2. UNIX for Dummies Questions & Answers
Does anyone know how to find the best least square fit in Gnuplot? (6 Replies)
Discussion started by: cosmologist
6 Replies
3. Programming
Hi Iam getting the following error...
ld.so.1: xxxx: fatal: relocation error: file /home/costar4/bin/xxxx: symbol __1cH__rwstdUInterlockedIncrement6Fpl_l_: referenced symbol not found.
Can anyone tell me anything in this ?
Thanks,
Sanja (1 Reply)
Discussion started by: sanjasam
1 Replies
4. Programming
I have 2 directories: a1 and b1
Directory b1 depends on directory a1
Using directory a1, I create a1.lib
Using directory b1, I create b1.lib
Now, using a1 and b1, I create a shared object ab1.so
I've been able to build ab1.so just fine. I made an update to file b1.c
and am now getting a... (1 Reply)
Discussion started by: houdini_1
1 Replies
5. UNIX for Dummies Questions & Answers
i am reading APUE now,and the OS in the book seems different from RH9,which i installed in my computer.
can you tell me if a linux environment can help me really understand the APUE?If not,which OS i should try,the BSD?
THANKS (1 Reply)
Discussion started by: mayuhao
1 Replies
6. UNIX for Advanced & Expert Users
when running make command i'm getting the following error:
make:relocation error:make:symbol_sprintf_chk,version GLIBC_2.3.4 not defined in file libc.so.6 with link time reference...
plz tell me what to do abt this... (1 Reply)
Discussion started by: abhi1826
1 Replies
7. UNIX for Dummies Questions & Answers
Hello everyone.
I'm a Chinese student.I want to learn something about OS, someone
suggests me start with FreeBSD or Linux. Please tell me which one is more fit
for new man. Thanks. (4 Replies)
Discussion started by: discoverer8713
4 Replies
reloc(5) File Formats Manual reloc(5)
Name
reloc - relocation information for a MIPS object file
Syntax
#include <reloc.h>
Description
Object files have one relocation entry for each relocatable reference in the text or data. If relocation information is present, it will
be in the following format:
struct reloc
{
long r_vaddr ; /* (virtual) address of reference */
long r_symndx ; /* index into symbol table */
ushort r_type ; /* relocation type */
unsigned r_symndx:24, /* index into symbol table */
r_reserved:3,
r_type:4, /* relocation type */
r_extern:1; /* if 1 symndx is an index into the
external symbol table, else symndx
is a section # */
} ;
/* Relocation types */
#define R_ABS 0
#define R_REFHALF 1
#define R_REFWORD 2
#define R_JMPADDR 3
#define R_REFHI 4
#define R_REFLO 5
#define R_GPREL 6
#define R_LITERAL 7
/* Section numbers */
#define R_SN_NULL 0
#define R_SN_TEXT 1
#define R_SN_RDATA 2
#define R_SN_DATA 3
#define R_SN_SDATA 4
#define R_SN_SBSS 5
#define R_SN_BSS 6
#define R_SN_INIT 7
#define R_SN_LIT8 8
#define R_SN_LIT4 9
The link editor reads each input section and performs relocation. The relocation entries direct how references found within the input sec-
tion are treated.
If is zero, it is a local relocation entry and then is a section number (R_SN_*). For these entries, the starting address for the section
referenced by the section number is used in place of an external symbol table entry's value. The assembler and loader always use local
relocation entries if the item to be relocated is defined in the object file.
For every external relocation (except R_ABS) a signed constant is added to the symbol's virtual address that the relocation entry refers
to. This constant is assembled at the address being relocated.
R_ABS The reference is absolute and no relocation is necessary. The entry will be ignored.
R_REFHALF A 16-bit reference to the symbol's virtual address.
R_REFWORD A 32-bit reference to the symbol's virtual address.
R_JMPADDR A 26-bit jump instruction reference to the symbol's virtual address.
R_REFHI A reference to the high 16 bits of the symbol's virtual address. The next relocation entry must be the corresponding
R_REFLO entry, so the proper value of the constant to be added to the symbol's virtual address can be reconstructed.
R_REFLO A reference to low 16 bits to the symbol's virtual address.
R_GPREL A 16-bit offset to the symbol's virtual address from the global pointer register.
R_LITERAL A 16-bit offset to the literal's virtual address from the global pointer register.
Relocation entries are generated automatically by the assembler and automatically used by the link editor. Link editor options exist for
both preserving and removing the relocation entries from object files.
The number of relocation entries for a section is found in the field of the section header. This field is a C language short and can over-
flow with large objects. If this field overflows, the section header field has the S_NRELOC_OVFL bit set. In this case, the true number
of relocation entries is found in the field of the first relocation entry for that section. That relocation entry has a type of R_ABS, so
it is ignored when the relocation takes place.
See Also
as(1), ld(1), a.out(5), syms(5), scnhdr(5)
RISC reloc(5)