Re: string constants in -fpie mode?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 29, 2016 at 04:01:51PM -0600, Tycho Andersen wrote:
> $ gcc -c -fpie -Wa,--noexecstack -fno-jump-tables -nostdlib tester.c -o tester.o
> $ ld -r tester.o -o tester.bin

Are you sure you want -r?

> So now I'm confused. .rodata is clearly my string (using a cheap hack by doing
> objdump -D to display it), but the code at 0x4 in .text has me confused,
> 
>    4: 48 8d 05 00 00 00 00  lea    rax,[rip+0x0]        # b <main+0xb>

You should always use the -r flag to objdump when disassembling object
files.


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux