bash-3.1$ cat foo.c
extern char x __attribute__((weak, visibility("hidden")));
void *_start(void) { return &x; }
bash-3.1$ make
gcc -fPIC -c -o foo.o foo.c
ld -Ttext 1 -o foo foo.o
objdump -dr foo.o
foo.o: file format elf64-x86-64
Disassembly of section .text:
<_st
--- Additional Comments From dannysmith at users dot sourceforge dot net
2006-09-29 03:37 ---
Fixed
--
What|Removed |Added
Status|ASSIGNED|RE
--
What|Removed |Added
AssignedTo|unassigned at sources dot |dannysmith at users dot
|redhat dot com |sourceforge dot net
http://sourceware
--- Additional Comments From dannysmith at users dot sourceforge dot net
2006-09-29 03:35 ---
Assigning to self...
--
What|Removed |Added
Status|NEW
--- Additional Comments From dannysmith at users dot sourceforge dot net
2006-09-28 23:15 ---
Patch here:
http://sourceware.org/ml/binutils/2006-09/msg00377.html
Danny
--
http://sourceware.org/bugzilla/show_bug.cgi?id=3276
--- You are receiving this mail because: ---
You are
--- Additional Comments From hjl at lucon dot org 2006-09-28 21:55 ---
Created an attachment (id=1334)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=1334&action=view)
A patch to show the bug
With this patch, "make check" in ld gives:
FAIL: objcopy -shared -z relro (tbss1)
FAIL:
bjcopy changes PT_GNU_RELRO segment when there is PT_TLS segment.
--
Summary: objcopy changes PT_GNU_RELRO when there is PT_TLS
Product: binutils
Version: 2.18 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: bin
On Thu, 2006-09-28 at 07:42 +, jespdj at hotmail dot com wrote:
> g++ outputs the correct assembler code, so the error must be in as or ld.
Or, more likely, in the OS. Try running objdump -x on your executable.
If the .rdata section has alignment 2**4, then the linker is OK. It is
your OS (i
--- Additional Comments From wilson at specifix dot com 2006-09-28 21:30
---
Subject: Re: New: Alignment error with static const
variable in inline function
On Thu, 2006-09-28 at 07:42 +, jespdj at hotmail dot com wrote:
> g++ outputs the correct assembler code, so the erro
--
What|Removed |Added
GCC target triplet||i686-pc-cygwin
http://sourceware.org/bugzilla/show_bug.cgi?id=3276
--- You are receiving this mail becaus
--- Additional Comments From jespdj at hotmail dot com 2006-09-28 08:07
---
Sorry, meant to include the version info of ld instead of ln:
$ ld --version
GNU ld version 2.17.50 20060817
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it u
--- Additional Comments From jespdj at hotmail dot com 2006-09-28 08:06
---
$ as --version
GNU assembler 2.17.50 20060817
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program
--- Additional Comments From jespdj at hotmail dot com 2006-09-28 07:48
---
Actually the output of running the above program is slightly different (the
address is different), but still wrong:
$ ./tst
sizeof(x) = 4, __alignof__(x) = 16
Address of x: 0x40F418 - ALIGNMENT ERROR
--
htt
--- Additional Comments From jespdj at hotmail dot com 2006-09-28 07:45
---
Created an attachment (id=1333)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=1333&action=view)
Assember code produced by g++
This is the assembler code produced by g++ when compiling the source with:
I initially entered this bug in the GCC bug database, but the bug seems not to
be in GCC, but probably in binutils. See GCC bug 29249:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29249
The problem is this: I have a small C++ program that requires an int to be
aligned on a 16 byte boundary. When I
15 matches
Mail list logo