relocation

C compiling: relocation truncated to fit R_X86_64_PC32 against symbol

跟風遠走 提交于 2021-02-08 07:42:34
问题 /* my program author/date: me/now */ # include <stdio.h> # define XX 1000 # define YY 20000 /* value of 1000 is ok */ # define ZZ 6000 /* global variable declaration */ int some_variable_this; int some_variable_that; double data[XX][YY][ZZ]; static void some_procedure_this ( void ) { } static void some_procedure_that ( void ) { } int main ( int argc, char *argv[] ) { } writing a quick C program to reformat some data. when compiling via gcc myprogram.c if I make the global data array too large

ElasticSearch cluster auto relocation unbalanced

帅比萌擦擦* 提交于 2021-02-08 05:34:07
问题 I have 7 nodes in my es cluster with the same cpu and memory. 5 of them have three 1T disks, the other 2 have only one 1T disk. I find that the shards on my cluster frequently relocate, but the disk usage is very unbalanced, for example as below: usage: 34% free: 1.94TB total: 2.95TB usage: 55% free: 1.33TB total: 2.95TB usage: 57% free: 1.27TB total: 2.93TB usage: 46% free: 1.60TB total: 2.95TB usage: 55% free: 1.31TB total: 2.93TB usage: 90% free: 100.40GB total: 1007.93GB usage: 85% free:

Missing Abstract Class using Maven Shade Plugin for Relocating Classes

喜夏-厌秋 提交于 2020-08-10 19:34:12
问题 I am currently using Maven Shade plugin to relocate classes but it comes with the following issue: My project has a dependency on netty-all package: <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.51.Final</version> </dependency> Due to a version conflict issue on this netty package, I need to relocate the classes within netty to avoid this conflict. I was trying to relocate classes from io.netty to com.shaded.io.netty using the plugin configurations

What's the difference between R_386_PC32 and R_X86_64_PC32 in link(GNU ld) relocation process

大兔子大兔子 提交于 2020-01-25 03:46:31
问题 When reading the book Computer System: A Programmer's Perspective Section 7.7.1 Relocation Entries: the brief content of this section is how a linker relocate reference in a different object file. When compile and objdump the example source code: void swap(); int buf[2] = {1, 2}; int main() { swap(); return 0; } Then gcc -Wall -c -o main.o main.c, and objdump -S -r main.o > main.asm; and will see the relocation entry for swap: 6: e8 fc ff ff ff call 7 <main+0x7> swap(); 7: R_386_PC32 swap

Relocation strings using awk/sed from a index file

巧了我就是萌 提交于 2019-12-25 07:35:26
问题 I'd always appreciate all helps from this website. I would like to relocate strings based on the index number from an index file. Index numbers are shown on the first column in the index file (index.txt) and I would like to relocate "path" based on index numbers. Paths are placed in the same row if the index number is the same. For example, there are two zeros so path_sparc_ifu_dec_in_3826 is placed on the first row and path_sparc_ifu_dec_in_4349 is placed on the first row and next to path

Relative-to-executable path to ld-linux dynamic linker/interpreter

孤街浪徒 提交于 2019-12-23 22:29:07
问题 I want to ship and archive binaries (executables with libraries) which are backward and forward compatible with as many Linux distributions as possible and the whole package relocatable. As I understand system libraries like libc also need to be shipped because the executable will crash given a different version of libc . Meanwhile libc seems to be coupled with ld-linux (e.g. binaries compiled on Debian testing already does not work on Ubuntu 18.04 LTS), so I need to package ld-linux too. My

Dynamic relocation of code section

孤人 提交于 2019-12-21 07:29:23
问题 Just out of curiosity I wonder if it is possible to relocate a piece of code during the execution of a program. For instance, I have a function and this function should be replaced in memory each time after it has been executed. One idea that came up our mind is to use self-modifying code to do that. According to some online resources, self-modifying code can be executed on Linux, but still I am not sure if such a dynamic relocation is possible. Has anyone experience with that? 回答1: Yes

AArch64 relocation prefixes

不问归期 提交于 2019-12-19 02:31:50
问题 I noticed a GNU asm relocation syntax for ARM 64-bit assembly. What are those pieces like #:abs_g0_nc: and :pg_hi21: ? Where are they explained? Is there a pattern to them or are they made up on the go? Where can I learn more? 回答1: Introduction ELF64 defines two types of relocation entries, called REL and RELA : typedef struct { Elf64_Addr r_offset; /* Address of reference */ Elf64_Xword r_info; /* Symbol index and type of relocation */ } Elf64_Rel; typedef struct { Elf64_Addr r_offset; /*

ELF Relocation reverse engineering

為{幸葍}努か 提交于 2019-12-13 14:28:28
问题 I am hoping you guys could help me understand how relocation entries and ELF section data are related, and how it is all processed and generated. I have an ancient unsupported tool that takes an ELF file and a related PLF file (partially linked file, generated earlier in the build process) and builds a custom relocatable file from it that is used on a platform (PPC) with tight memory constraints. This works fine except that it contains about a meg of initialization code that we want to unload

GCC-Assemby Error: Relocation R_X86_64_32S against '.data'

社会主义新天地 提交于 2019-12-13 05:59:26
问题 Situation Enviroment Arch Linux x86-64 (4.2.3-1-ARCH) GCC gcc (GCC) 5.2.0 Command gcc -Wall -g -o asm_printf asm_printf.s Error /usr/bin/ld: /tmp/cct4fa.o: Relocation R_X86_64_32S against '.data' can not be used when making a shared object; recompile with -fPIC /tmp/cct4fa.o:err adding symbols: Bad value collect2: error: ld returned 1 exit status Code .section .data msg: .asciz "Printf In Assembly!!\n" .section .text .globl main main: pushq $msg call printf addq $8 %esp pushq $0 call exit