Bug 621742
Summary: | linker script doesn't allow section name patterns with caret symbol (^) | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Denys Vlasenko <dvlasenk> |
Component: | binutils | Assignee: | Nick Clifton <nickc> |
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 19 | CC: | dvlasenk, jakub, nickc |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-02-18 11:05:31 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Denys Vlasenko
2010-08-06 01:59:43 UTC
Oops.. I made a mistake in the first directive example, and then cut-n-pasted it, so all examples have the same mistake... instead of .text: { *(.text.[^.]* ) it should be .text: { *(.text.[^.]*) } The right way to negate a character class is to use ! as the first character (see glob(7)). Thanks Andreas, I did not know that. Unfortunately, the [!foo] construct seems to be rejected: I performed the following test: Created a test module test.c: void __attribute__((section(".text..f"))) f() {} void __attribute__((section(".text.g"))) g() {} Produced test.o: $ gcc -c test.c "Incrementally linked" it into a test1.o, adding --verbose to recover the internal linker script: $ ld -r -o test1.o test.o --verbose >test.lds Edited test.lds: removed everything except linker script, and added .text.nodot : { *(.text.[!.]*) } just before existing ".text: ...." rule. When I try to use the script, ld errors out: $ ld -r -o test1.o test.o -T test.lds ld:test.lds:44: syntax error Same happens with .text.nodot : { *(.text.[!A-Z]*) } rule, so it's not because of the dot inside []. .text.nodot : { *(.text.[.]*) } works, thus I conclude that it's [!foo] construct that is not supported. $ ld --version GNU ld version 2.20.51.0.2-20.fc13 20091009 Hi Denys, Thanks for reporting this bug. You were right the caret character ought to be able to invert the sense of the match. Andreas was also correct in that the exclamation point character should have been able to do the same thing. In fact *both* characters ought to be added to the WILDCHAR definition and this is exactly what I have done with the latest rawhide binutils rpm (binutils-2.20.51.0.10-3.fc15). Incidentally there is another way to solve the original problem if you do not mind the sections containing two successive period characters appearing before the sections containing only single period characters. Like this: .text : { *(*.text) *(.text..*) } .text.nodot : { *(.text.*) } Cheers Nick Clifton Thanks! > In
> fact *both* characters ought to be added to the WILDCHAR definition and this is
> exactly what I have done with the latest rawhide binutils rpm
> (binutils-2.20.51.0.10-3.fc15).
Will it go into next upstream release too?
Yes. This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19 This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |