Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(831)

Issue 8243015: Fix linker script alignment of TLS sections (Closed)

Created:
9 years, 2 months ago by Roland McGrath
Modified:
9 years, 2 months ago
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Fix linker script alignment of TLS sections The linker script syntax means something different if ALIGN(...) is before or after the : in an input section line. With it after the : it sets the sh_addralign of the output section. This is what's necessary for the resolution of tpoff(var) to take the alignment into account correctly. We need the sh_addralign to be only 16, not 32. BUG= http://code.google.com/p/nativeclient/issues/detail?id=2330 TEST= hand-tested

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M binutils-2.20/ld/scripttempl/naclelf.sc View 1 chunk +2 lines, -2 lines 2 comments Download

Messages

Total messages: 4 (0 generated)
Roland McGrath
PTAL
9 years, 2 months ago (2011-10-12 19:47:01 UTC) #1
sehr (please use chromium)
lgtm
9 years, 2 months ago (2011-10-12 19:52:36 UTC) #2
Roland McGrath
Committed 05d2e85efec6
9 years, 2 months ago (2011-10-12 19:54:14 UTC) #3
krasin
9 years, 2 months ago (2011-10-12 19:56:07 UTC) #4
lgtm

http://codereview.chromium.org/8243015/diff/1/binutils-2.20/ld/scripttempl/na...
File binutils-2.20/ld/scripttempl/naclelf.sc (right):

http://codereview.chromium.org/8243015/diff/1/binutils-2.20/ld/scripttempl/na...
binutils-2.20/ld/scripttempl/naclelf.sc:461:
.tdata	${RELOCATING+ALIGN(0x20)}${RELOCATING-0} : ALIGN(0x10) {
The line itself looks fine (modulo my linker script illiteration). My concern is
that it would be absolutely impossible to avoid a regression in the future.

I'm fine to write a test myself, though.

http://codereview.chromium.org/8243015/diff/1/binutils-2.20/ld/scripttempl/na...
binutils-2.20/ld/scripttempl/naclelf.sc:467:
.tbss		${RELOCATING+ALIGN(0x20)}${RELOCATING-0} : ALIGN(0x10) {
I'm not sure, if this line is required. bss is put right after tdata and the
code in src/untrusted/nacl/tls.c does not care about alignment tbss. At the same
time, since .tdata size is a multiply of 0x20 and it's aligned by 0x10, .tbss
will be automatically aligned by 0x10.

Powered by Google App Engine
This is Rietveld 408576698