Questions tagged [got]

Global Offset Table (dynamic linking) FOR THE NODE.JS REQUEST LIBRARY USE [node.js-got]

For more, see

47 questions
1
vote
1 answer

Does every .so file have a PLT/GOT?

I've been thinking about this for a while because I've observed that even really fundamental libraries like libc have a GOT/PLT, consisting of important functionality such as malloc() and its friends. Is it even possible to create a shared library…
rmg
  • 59
  • 5
0
votes
0 answers

Does every shared library get its own .got and .plt section?

I have the following source code (mathsource.c) which I compiled and linked as follows: gcc -fpic -c mathsource.c gcc -o lib/libmath.so.1.2.3 mathsource.o -shared -Wl,-soname,libmath.so.1 int add_nums(int a, int b) { return a + b; } int…
qwerty_url
  • 535
  • 4
  • 12
0
votes
0 answers

Efficient access to function-local constant data in PIC code, without going through the GOT

In code such as… extern const long long *tget(void); static const signed long long o[2] = { -1, 1 }; long long tmogrify(long long t) { long long l; const signed long long *op; long long u = t; const long long *lp =…
mirabilos
  • 5,123
  • 2
  • 46
  • 72
0
votes
1 answer

Global Offset Table: "Pointers to Pointers"? Is this handled by the loader?

This question is about Linux (Ubuntu) executables. I'll detail things as I understand them to make it clearer if anything's off (so please correct me where applicable): The GOT acts an extra level of indirection to enable accessing data from a text…
Shay
  • 587
  • 4
  • 13
0
votes
1 answer

Identify entries in a global offset table

I'm attempting to write some ELF parsing logic (in C). Specifically, I'm trying to identify which entries in the GOT correspond to which functions. I've crafted a simple program which contains references to malloc and free. Some relevant excerpts…
Daniel Walker
  • 6,380
  • 5
  • 22
  • 45
0
votes
1 answer

MCU/embedded: Position independent code, max size for .got section?

I am trying to get my project "position independent", but it won't give... Some background: nxp imx rt 1024 evk board c++ project compiled both C and C++ files with -fPIC, -msingle-pic-base -mno-pic-data-is-text-relative a working prototype where I…
bas
  • 13,550
  • 20
  • 69
  • 146
0
votes
0 answers

In shared objects, why does gcc relocate through the GOT for global variables which are defined in the same shared object?

While answering another question on Stack, I came upon a question myself. With the following code in shared.c: #include "stdio.h" int glob_var = 0; void shared_func(){ printf("Hello World!"); glob_var = 3; } Compiled with: gcc -shared…
user123
  • 2,510
  • 2
  • 6
  • 20
0
votes
1 answer

How are the entries for Global Symbols that are not functions initialized in the Global Offset Table?

So I am trying to learn about dynamic linking. On SysV ABI on amd64, functions from other shared libraries can be loaded lazily via the Procedure Linkage Table by initializing the GOT entry for the function to point at the next instruction in its…
Siam Habib
  • 33
  • 2
0
votes
0 answers

Couldn't find the dynamic reference of the function in Global Offset Table

I have made a go plugin which contains references to third party libraries. So I have a sample function which looks like this: CreateEchoObject() *echo.Echo { e := echo.New() } The disassembled code of CreateEchoObject contains: callq 8b9ab0…
0
votes
0 answers

Dynamic Linking Libraries in C++

I was following the liveoverflow course about binary exploitation, when i got trouble following a part of his video. In the video is shown a binary linked to a library which calls the function puts, on the video is shown that before executing for…
0
votes
2 answers

What is the difference between Import Address Table and Global Offset Table?

I tried googling them separately, but one thing stuck out the most. Is it just that IAT is for PE files and GoT is for ELF?
Neetika Bishwas
  • 61
  • 1
  • 1
  • 8
0
votes
1 answer

how to fill off global offset table?

Motivation: I want to test gcc's limition size of global offset table on my arch(x86). What I have done: use multiple undeclared functions in a shared library (gcc -nostdlib -shared -o got.so ./got.c) // got.c extern int itestvariable1; extern int…
Chen Li
  • 4,824
  • 3
  • 28
  • 55
0
votes
1 answer

How to suppress "invalid read" warning for GOT in valgrind?

I am running valgrind memcheck as part of my unit tests. Valgrind issues an "Invalid read of size 8" for a specific test views and modifies the GOT (Global Offset Table) of the process. I would like to suppress this warning preferably for just the…
smichak
  • 4,716
  • 3
  • 35
  • 47
0
votes
0 answers

A position-dependent data type section in a PIC code?

I have a binary depending on several shared libraries and I would like to produce a PIC binary except for one read-only table. I want all code sections to be able to access this table without adhering to .GOTPCREL. I do not care in what kind of data…
masec
  • 584
  • 5
  • 16
0
votes
1 answer

Can I get symbol name by "GOT address"?

Now I'm developing program like readelf using pyelftools libraries. I want to print the table like below. In here, Offset field is stderr@GOT address. jiwon@jiwon$ readelf -a --wide libstdbuf.so ... Relocation section '.rel.dyn' at offset…
Jiwon
  • 1,074
  • 1
  • 11
  • 27