[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/12921] sh_offset for SHT_NOBITS sections
From: |
amodra at gmail dot com |
Subject: |
[Bug ld/12921] sh_offset for SHT_NOBITS sections |
Date: |
Thu, 23 Jun 2011 15:08:36 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=12921
--- Comment #6 from Alan Modra <amodra at gmail dot com> 2011-06-23 15:08:03
UTC ---
Actually older binutils do give cases of sh_offset past end of file.
ld/testsuite/ld-elf/tbss3.s assembled and linked with older binutils gives
.tbss with sh_offset past end of file. The same file s/tbss/bss/ and correct
.bss section flags and you'll see the same thing with .bss.
Now, if I revert the elf.c part of
http://sourceware.org/ml/binutils/2011-05/msg00299.html you'll have what you
want for your testcase, but then in the tbss3.s case .tbss will have sh_offset
of zero and PT_TLS segment will have p_offset of zero. Not that there is
anything really wrong with a zero for sh_offset of SHT_NOBITS sections or zero
p_offset for zero p_filesz headers. In fact that would be the logical value to
choose for a section/header that doesn't have contents in the file. I wonder
what would break if we did that for all such sections and headers? Probably
quite a lot, which is why I was trying to set sh_offset to as unsurprising a
value as I thought possible. I chose such that sh_addr % sh_align == sh_offset
% sh_align to make the tbss3 testcase give the same sh_offset and p_offset as
older linkers.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
- [Bug ld/12921] New: sh_offset for SHT_NOBITS sections, jakub at redhat dot com, 2011/06/22
- [Bug ld/12921] sh_offset for SHT_NOBITS sections, amodra at gmail dot com, 2011/06/22
- [Bug ld/12921] sh_offset for SHT_NOBITS sections, amodra at gmail dot com, 2011/06/22
- [Bug ld/12921] sh_offset for SHT_NOBITS sections, jakub at redhat dot com, 2011/06/23
- [Bug ld/12921] sh_offset for SHT_NOBITS sections, hjl.tools at gmail dot com, 2011/06/23
- [Bug ld/12921] sh_offset for SHT_NOBITS sections, jakub at redhat dot com, 2011/06/23
- [Bug ld/12921] sh_offset for SHT_NOBITS sections,
amodra at gmail dot com <=
- [Bug ld/12921] sh_offset for SHT_NOBITS sections, amodra at gmail dot com, 2011/06/23
- [Bug ld/12921] sh_offset for SHT_NOBITS sections, hjl.tools at gmail dot com, 2011/06/23
- [Bug ld/12921] sh_offset for SHT_NOBITS sections, cvs-commit at gcc dot gnu.org, 2011/06/23
- [Bug ld/12921] sh_offset for SHT_NOBITS sections, cvs-commit at gcc dot gnu.org, 2011/06/23
- [Bug ld/12921] sh_offset for SHT_NOBITS sections, amodra at gmail dot com, 2011/06/24
- [Bug ld/12921] sh_offset for SHT_NOBITS sections, cvs-commit at gcc dot gnu.org, 2011/06/24